Skip to content

Instantly share code, notes, and snippets.

@thomasyip
Last active September 23, 2015 21:18
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomasyip/618005 to your computer and use it in GitHub Desktop.
Save thomasyip/618005 to your computer and use it in GitHub Desktop.
/**
* Here is the simplified version. Courtesy of Mike Koss.
*
* See, http://labnote.beedesk.com/the-pitfalls-of-html5-applicationcache
*/
function handleAppCache() {
if (applicationCache == undefined) {
return;
}
if (applicationCache.status == applicationCache.UPDATEREADY) {
applicationCache.swapCache();
location.reload();
return;
}
applicationCache.addEventListener('updateready', handleAppCache, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment