Web applications cache.manifest第一次工作,然后失败

Web applications cache.manifest第一次工作,然后失败,web-applications,html,Web Applications,Html,我正在尝试将HTML5缓存添加到web应用程序中,没有什么太复杂的东西,只是images/css/js 在编辑cache.manifest文件后加载页面时,我在Chrome 8中得到以下调试: Creating Application Cache with manifest http://example.com/themes/zenmobile/cache.manifest Application Cache Checking event Application Cache Downloadin

我正在尝试将HTML5缓存添加到web应用程序中,没有什么太复杂的东西,只是images/css/js

在编辑cache.manifest文件后加载页面时,我在Chrome 8中得到以下调试:

Creating Application Cache with manifest http://example.com/themes/zenmobile/cache.manifest
Application Cache Checking event
Application Cache Downloading event
Application Cache Progress event (0 of 26) http://example.com/themes/zenmobile/plugins/img/toolbar.png
Application Cache Progress event (1 of 26) http://example.com/themes/zenmobile/plugins/img/greenButton.png
Application Cache Progress event (2 of 26) http://example.com/themes/zenmobile/plugins/jqtouch.transitions.js
Application Cache Progress event (3 of 26) http://example.com/themes/zenmobile/plugins/img/back_button_clicked.png
Application Cache Progress event (4 of 26) http://example.com/themes/zenmobile/plugins/img/button.png
Application Cache Progress event (5 of 26) http://quizible.com/sites/all/modules/jquery_update/replace/jquery.min.js
Application Cache Progress event (6 of 26) http://example.com/themes/zenmobile/plugins/img/grayButton.png
Application Cache Progress event (7 of 26) http://example.com/themes/zenmobile/plugins/img/chevron_circle.png
Application Cache Progress event (8 of 26) http://example.com/themes/zenmobile/plugins/img/on_off.png
Application Cache Progress event (9 of 26) http://example.com/themes/zenmobile/plugins/jqtouch.js
Application Cache Progress event (10 of 26) http://example.com/themes/zenmobile/layout.css
Application Cache Progress event (11 of 26) http://example.com/themes/zenmobile/plugins/img/chevron.png
Application Cache Progress event (12 of 26) http://example.com/themes/zenmobile/plugins/img/rowhead.png
Application Cache Progress event (13 of 26) http://example.com/themes/zenmobile/zenmobile.css
Application Cache Progress event (14 of 26) http://example.com/themes/zenmobile/plugins/img/loading.gif
Application Cache Progress event (15 of 26) http://example.com/themes/zenmobile/plugins/img/redButton.png
Application Cache Progress event (16 of 26) http://example.com/themes/zenmobile/plugins/img/activeButton.png
Application Cache Progress event (17 of 26) http://example.com/themes/zenmobile/images/bg_body.png
Application Cache Progress event (18 of 26) http://example.com/themes/zenmobile/plugins/theme.css
Application Cache Progress event (19 of 26) http://example.com/themes/zenmobile/plugins/img/toggle.png
Application Cache Progress event (20 of 26) http://example.com/themes/zenmobile/plugins/img/whiteButton.png
Application Cache Progress event (21 of 26) http://example.com/themes/zenmobile/plugins/img/toggleOn.png
Application Cache Progress event (22 of 26) http://example.com/themes/zenmobile/plugins/jqtouch.css
Application Cache Progress event (23 of 26) http://example.com/themes/zenmobile/plugins/img/button_clicked.png
Application Cache Progress event (24 of 26) http://example.com/themes/zenmobile/plugins/img/back_button.png
Application Cache Progress event (25 of 26) http://example.com/themes/zenmobile/plugins/img/blueButton.png
Application Cache Progress event (26 of 26) 
Application Cache Cached event
当我再次刷新页面时,所有css/images/js都无法加载,控制台日志会弹出:

Document was loaded from Application Cache with manifest http://example.com/themes/zenmobile/cache.manifest
Application Cache Checking event
Application Cache NoUpdate event
然后加载“加载资源失败”


除了这个输出,我还没有发现任何有用的东西来尝试修复这个问题。以前有人见过吗?

html5清单很难处理。如果它在一个浏览器中工作,则可能在另一个浏览器中不工作

1) 查看您的“资源”选项卡,查看导致错误的资源(使用firebug或webkit)

2) 我发现在每次部署时更改清单名称有助于确保浏览器检测到更改。

是否正在加载清单文件中没有的其他资源?试着把它们全部列出,看看你是否仍然有问题。

也有同样的问题。将此放在底部,为我修复了它:

NETWORK:
*
为了解决大多数人在清单更新中遇到的问题,这种方法对我来说非常有效:

在url中附加清单文件和所有缓存资源的版本号,并将清单的内容设置为引用该版本号。像这样:

<html manifest="path/to/cache.manifest?v=42">

我已经为我们实现了自动化,所以在一个新的部署中,我只是将这个数字提高了1(在我阅读的设置文件中的某个地方),并且它在所有提到的文件中都会受到影响。每个浏览器请求不仅会检测清单文件的更改,还会导致重新加载(和缓存)提到的每个资源,从而更新整个应用程序。

您的cache.manifest文件中是否声明了任何回退资源?没有,没有回退资源。
CACHE MANIFEST
#rev ?v=42

/css/foo.css?v=42
/css/bar.css?v=42
/js/script.js?v=42