Application cache is cool but it takes some work to get it right I’m finding. One little gotcha I just came across goes like this:
Seeing my new build and updated app cache manifest, Chrome downloads and caches the new (bad) bits, and seeing this, my old code reboots the page swapping in the newly updated app bits. Problem is the newly cached bits have a script error I introduced into an application cache event callback handler. F is for FAIL.
Normally, fixing the script error, rebuilding and refreshing the browser corrects the problem. But not in this case.
Correcting the error and touching the app cache manifest file does correctly trigger a client-side app cache refresh in the browser (here Chrome). But my bug crashes the page before the the app cache has been refreshed and before the point where my handlers would normally swap in the update.
So you’re basically screwed in this case because the app is horked and you can’t update it by fixing the bits on the server…
Luckily chrome://appcache-internals/ can undo this evil.