Skip to content

Instantly share code, notes, and snippets.

@jelmerdemaat
Created March 22, 2017 07:41
Show Gist options
  • Save jelmerdemaat/74a46b3389afd532d34bf44652f7a1b0 to your computer and use it in GitHub Desktop.
Save jelmerdemaat/74a46b3389afd532d34bf44652f7a1b0 to your computer and use it in GitHub Desktop.
Service worker example
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open('sw-v1').then(function(cache) {
return cache.addAll([
'./',
'style.css',
'main.js'
]);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment