Skip to content

Instantly share code, notes, and snippets.

@petebrowne
Last active February 19, 2016 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petebrowne/1c677716b3bd1ed7c335 to your computer and use it in GitHub Desktop.
Save petebrowne/1c677716b3bd1ed7c335 to your computer and use it in GitHub Desktop.
var CACHE_VERSION = 1;
var CACHE_NAME = `example-4_${CACHE_VERSION}`;
var OFFLINE_URL = 'offline.html';
var CACHE_URLS = [
OFFLINE_URL
];
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME).then(cache => {
return cache.addAll(CACHE_URLS);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment