Skip to content

Instantly share code, notes, and snippets.



Last active Jul 25, 2017
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.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