Skip to content

Instantly share code, notes, and snippets.

@kypflug

kypflug/sw-6.js Secret

Created Dec 15, 2017
Embed
What would you like to do?
self.onactivate = function(event) {
var keepList = ['static-v1'];
event.waitUntil(
caches.keys().then(function(cacheNameList) {
return Promise.all(cacheNameList.map(function(cacheName) {
if (keepList.indexOf(cacheName) === -1) {
return caches.delete(cacheName);
}
}));
})
);
}
@digitaico

This comment has been minimized.

Copy link

@digitaico digitaico commented Dec 20, 2017

Hi, can you tell me please what cacheNameList is? is an API object or a variable defined by you? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment