Skip to content

Instantly share code, notes, and snippets.

@petmat
Created August 6, 2017 19:22
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 petmat/e58a22e3d69a74ec4c9a46cd21a5944a to your computer and use it in GitHub Desktop.
Save petmat/e58a22e3d69a74ec4c9a46cd21a5944a to your computer and use it in GitHub Desktop.
self.addEventListener('install', function(e) {
console.log('[ServiceWorker] Install');
e.waitUntil(
caches.open(cacheName).then(function(cache) {
console.log('[ServiceWorker] Caching app shell');
return cache.addAll(filesToCache);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment