fix(sw): aggressively clear ALL caches on activate

This commit is contained in:
TheFlow 2025-10-26 15:50:57 +13:00
parent 28eb2ea624
commit cd0cdd45ff

View file

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