Uppdatera 'sw.js'

This commit is contained in:
Henrik Bygren 2022-06-07 14:53:17 +00:00
parent 0402d00ebd
commit 3e03a78078

16
sw.js
View File

@ -34,14 +34,14 @@
}); });
/** Rensar cache */ /** Rensar cache */
self.addEventListener('activate', (e) => { self.addEventListener('activate', (e) => {
e.waitUntil(caches.keys().then((keyList) => { e.waitUntil(caches.keys().then((keyList) => {
Promise.all(keyList.map((key) => { return Promise.all(keyList.map((key) => {
if (key === cacheKey) { return; } if (key === cacheKey) { return; }
caches.delete(key); return caches.delete(key);
})) }))
})()); }));
}); });
/** cache-filer först, upddaterar cache från servern */ /** cache-filer först, upddaterar cache från servern */
self.addEventListener('fetch', function (event) { self.addEventListener('fetch', function (event) {