-
-
Save albertoperezf/2186e64ccc67f5769a42066cbe1cccc4 to your computer and use it in GitHub Desktop.
Delete a cache file when a new one is ON with active
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', function(event) { | |
event.waitUntil( | |
caches.keys().then(function (cacheNames) { | |
return Promise.all( | |
cacheNames.filter(function (cacheNames) { | |
return cacheNames.startsWith('wittr-') && | |
cacheNames !== staticCacheName; | |
}).map(function (cacheNames) { | |
return caches.delete(cacheNames); | |
}) | |
) | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment