Created
March 19, 2019 09:11
-
-
Save danielpotthast/64f7331f86ea734e2f297efe15760f66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cleanup old cache storages | |
self.addEventListener("activate", event => { | |
event.waitUntil( | |
caches.keys() | |
.then(cacheNames => { | |
return Promise.all( | |
cacheNames.map(cacheName => { | |
if (CACHE_VERSION !== cacheName) { | |
return caches.delete(cacheName); | |
} | |
}) | |
); | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment