我正在开发一个供离线使用的网络应用程序,因此我需要使用应用程序缓存功能。
在 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
这是“主”HTML 文档的前 4 行:
<!DOCTYPE html>
<html manifest="/app/mobile/cache.manifest.php">
<head>
<title>MyApp Mobile</title>
当我尝试将缓存清单(http://www.myapp.com/app/mobile/cache.manifest.php)加载到浏览器中时,文件会正确显示,但是当我尝试离线加载页面时,我得到了“无法连接”错误页面。同样,这只是发生在 Firefox 和 Opera 上。
Firebug 说“ 0 items in offline cache
”,我没有找到检查 DragonFly 上的应用程序缓存的方法。
我很生气,我不知道如何在 Firefox 和 Opera 上有效地调试问题。请帮忙。
谢谢,丹