Skip to content

Instantly share code, notes, and snippets.

@beebole

beebole/index(html)2.js

Last active Jul 25, 2017
Embed
What would you like to do?
Mobile offline - AppCache setup
//Check if a new cache is available on page load.
window.addEventListener('load', function( ) {
window.applicationCache.addEventListener('updateready', function( ) {
if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
window.applicationCache.swapCache();
window.location.reload( true );
} else {
// Manifest didn't changed. Nothing new to server.
}
}, false);
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment