fix(sw): aggressively clear ALL caches on activate
This commit is contained in:
parent
28eb2ea624
commit
cd0cdd45ff
1 changed files with 5 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue