From a40ee2761a4cd8404ab1dc280a7f0fa72e73108b Mon Sep 17 00:00:00 2001 From: Kevin Burchell Date: Sun, 15 Nov 2026 10:23:13 -0800 Subject: [PATCH] Service worker: delete only this app's old caches Every app on krburchel.github.io shares one cache store, so clearing every unknown cache wiped the other apps' offline files on each update. Co-Authored-By: Claude Fable 5.2 --- sw.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sw.js b/sw.js index f726fa1..08cdaa3 100644 --- a/sw.js +++ b/sw.js @@ -23,7 +23,8 @@ self.addEventListener('install', function(e){ self.addEventListener('activate', function(e){ e.waitUntil( caches.keys().then(function(keys){ - return Promise.all(keys.filter(function(k){ return k !== CACHE; }) + // Only this app's caches: every app on krburchel.github.io shares one cache store. + return Promise.all(keys.filter(function(k){ return k.indexOf('brainfeed-') === 0 && k !== CACHE; }) .map(function(k){ return caches.delete(k); })); }).then(function(){ return self.clients.claim(); }) );