I have a rails app that I’m trying to get using HTML5 application caching using Rack::Offline. The application.manifest file is set up and is being downloaded and checked by my HTML page.
The manifest looks as follows:
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:
/
The page I’m accessing is localhost:3000/mobile, and it has cached wonderfully (viewable when I take down the rails server). However, the application.manifest file that it references has changed (in fact it changes with each request by manipulating the commented hexadecimal id), but Chrome is not updating the page. The console log in Chrome gives the following:
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
I don’t quite understand why it’s failing. It seems to be doing everything it should until the last line! I get a similar log if I navigate in my browser to localhost:3000/application.manifest – it seems that the manifest is cached itself, so could that be why it complains that the manifest has changed? Any ideas?
Thanks!
I was having the same problem, had to make a change to the gem itself. My problem had to do with nested folders in /public/images
Start by finding where your gems are installed (“gem environment” will get you that) and navigate into /rack-offline-0.6.1/lib.
Edit the file rack-offline.rb. Delete line 33 and replace with :
Restart your rails server and try again. Worked for me, hope it helps you.