-
-
Save kypflug/247156862fe818bd9f66e0b5812f0502 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
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); | |
} | |
})); | |
}) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, can you tell me please what cacheNameList is? is an API object or a variable defined by you? Thanks