我正在开发一个供离线使用的Web应用程序,因此我需要使用应用程序缓存功能.
一切都在Chrome(15.0.874.106)上运行良好,但在Firefox(7.0.1)和Opera(11.52)上不起作用.
这是我的缓存清单文件cache.manifest.php(我已将其减少到最低限度):
<?php
header("Cache-Control: max-age=0, no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: Wed, 11 Jan 1984 05:00:00 GMT");
header('Content-type: text/cache-manifest');
?>CACHE MANIFEST
CACHE:
/app/common/css/reset.css
/favicon.ico
Run Code Online (Sandbox Code Playgroud)
这是"主要"HTML文档的前4行:
<!DOCTYPE html>
<html manifest="/app/mobile/cache.manifest.php">
<head>
<title>MyApp Mobile</title>
Run Code Online (Sandbox Code Playgroud)
当我尝试将缓存清单(http://www.myapp.com/app/mobile/cache.manifest.php)加载到浏览器中时,文件显示正确,但是当我尝试离线加载页面时,我得到了"无法连接"错误页面.再次,这恰好发生在Firefox和Opera上.
Firebug说" 0 items in offline cache"并且我没有找到检查DragonFly上的应用程序缓存的方法.
我生气了,我不知道如何在Firefox和Opera上有效地调试问题.请帮忙.
谢谢,丹