Skip to content

Instantly share code, notes, and snippets.

@petebrowne
Created February 19, 2016 23:35
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/7f6e306cd0b6f8b7cc4a to your computer and use it in GitHub Desktop.
Save petebrowne/7f6e306cd0b6f8b7cc4a to your computer and use it in GitHub Desktop.
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request).then(response => {
return response || fetch(event.request);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment