Created
February 3, 2018 20:13
-
-
Save EduardoIbarra/3755f6979e5f9590c313b6fca8b43558 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 => { | |
const cacheWhitelist = ['nombre-cache-v2']; | |
event.waitUntil( | |
caches.keys().then(cacheNames => Promise.all( | |
cacheNames.map(cacheName => { | |
if (cacheWhitelist.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