Skip to content

Instantly share code, notes, and snippets.

@ukmadlz
Created May 10, 2017 17:08
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 ukmadlz/321102dc39c5ffe3ba6eba64589fabe2 to your computer and use it in GitHub Desktop.
Save ukmadlz/321102dc39c5ffe3ba6eba64589fabe2 to your computer and use it in GitHub Desktop.
Cloudinary PWA React Blog
// A new ServiceWorker is now active
self.addEventListener("activate", function (event) {
event.waitUntil(
caches.keys()
.then(function (cacheNames) {
return Promise.all(
cacheNames.map(function (cacheName) {
if (currentCacheNames.indexOf(cacheName) === -1) {
return caches.delete(cacheName);
}
})
);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment