Skip to content

Instantly share code, notes, and snippets.

@kypflug

kypflug/sw-6.js Secret

Created December 15, 2017 01:58
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 kypflug/247156862fe818bd9f66e0b5812f0502 to your computer and use it in GitHub Desktop.
Save kypflug/247156862fe818bd9f66e0b5812f0502 to your computer and use it in GitHub Desktop.
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
Copy link

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