fix(sw): aggressively clear ALL caches on activate

This commit is contained in:
TheFlow 2025-10-26 15:50:57 +13:00
parent a00a62503a
commit 69a4ffbf66

View file

@ -45,12 +45,11 @@ self.addEventListener('activate', (event) => {
event.waitUntil( event.waitUntil(
caches.keys().then((cacheNames) => { caches.keys().then((cacheNames) => {
return Promise.all( return Promise.all(
cacheNames // Delete ALL caches (including current) to force fresh fetch
.filter((name) => name !== CACHE_NAME) cacheNames.map((name) => {
.map((name) => { console.log('[Service Worker] Deleting cache:', name);
console.log('[Service Worker] Deleting old cache:', name); return caches.delete(name);
return caches.delete(name); })
})
); );
}).then(() => { }).then(() => {
// Take control of all clients immediately // Take control of all clients immediately