我正在开发一个用于离线使用的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
这是“主”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个项目”,而我找不到在DragonFly上检查应用程序缓存的方法。
我很烦恼,不知道如何有效地调试Firefox和Opera上的问题,请帮忙。
谢谢, Dan