mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-11 01:15:49 +08:00
clearing all caches that are different to the current cache
This commit is contained in:
parent
4486d2348c
commit
4de150422a
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,11 @@
|
|||
const staticCacheName = "sw-cache";
|
||||
|
||||
caches.keys().then(function (names) {
|
||||
for (let name of names) {
|
||||
if (name !== staticCacheName) caches.delete(name);
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener("install", (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(staticCacheName).then((cache) => {
|
||||
|
|
Loading…
Reference in a new issue