我有一个Rails应用程序,我正在尝试使用Rack::Offline使用HTML5应用程序缓存。 应用程序.manifest文件已设置并被我的HTML页面下载和检查。
清单如下:
CACHE MANIFEST
# 2d9bf2b03a07dc960fd8fe69659ceeffd4d28ccf8619669a506c3682bf223878
404.html
422.html
500.html
login.html
stylesheets/scaffold.css
javascripts/jquery.min.js
javascripts/jquery.js
javascripts/application.js
javascripts/rmbz.js
javascripts/rails.js
images/rails.png
NETWORK:
/
我正在访问的页面是localhost:3000/mobile,它已经缓存得很好(当我关闭rails服务器时可以查看)。然而,它引用的application.manifest文件已经改变(实际上每次请求都会通过操作注释的十六进制id来更改),但Chrome没有更新页面。Chrome的控制台日志显示如下:
Document was loaded from Application Cache with manifest http://localhost:3000/application.manifest
Application Cache Checking event
Application Cache Downloading event
Application Cache Progress event (0 of 12) http://localhost:3000/login.html
Application Cache Progress event (1 of 12) http://localhost:3000/404.html
Application Cache Progress event (2 of 12) http://localhost:3000/422.html
Application Cache Progress event (3 of 12) http://localhost:3000/javascripts/rails.js
Application Cache Progress event (4 of 12) http://localhost:3000/javascripts/rmbz.js
Application Cache Progress event (5 of 12) http://localhost:3000/images/rails.png
Application Cache Progress event (6 of 12) http://localhost:3000/500.html
Application Cache Progress event (7 of 12) http://localhost:3000/javascripts/jquery.js
Application Cache Progress event (8 of 12) http://localhost:3000/stylesheets/scaffold.css
Application Cache Progress event (9 of 12) http://localhost:3000/javascripts/jquery.min.js
Application Cache Progress event (10 of 12) http://localhost:3000/mobile
Application Cache Progress event (11 of 12) http://localhost:3000/javascripts/application.js
Application Cache Error event: Manifest changed during update, scheduling retry
我不太明白为什么它会失败。在最后一行之前,它似乎做了所有该做的事情!如果我在浏览器中导航到localhost:3000/application.manifest,我会得到类似的日志 - 看起来清单本身已经被缓存,那么这是否是它抱怨清单已更改的原因? 有什么想法吗?
谢谢!