Created
October 28, 2019 14:18
-
-
Save thepassle/b7921f750de94af44654ffd90f1a6868 to your computer and use it in GitHub Desktop.
lifecycle6
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
self.addEventListener('activate', event => { | |
event.waitUntil( | |
caches.keys().then(cacheNames => { | |
return Promise.all( | |
cacheNames | |
.filter(cacheName => cacheName.startsWith('my-cache-v') | |
&& cacheName !== CACHENAME) | |
.map(cacheName => caches.delete(cacheName)) | |
) | |
}) | |
) | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment