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