From ae61e19e09c5b867dfb3f543aa0a0a8d71ccc9d9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 30 Dec 2025 20:52:20 -0500 Subject: [PATCH] Reduce service worker caching to avoid stale bundles --- public/service-worker.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/public/service-worker.js b/public/service-worker.js index 2926574..9398ea6 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -1,8 +1,6 @@ // public/service-worker.js -const CACHE_NAME = 'sociowire-v3'; +const CACHE_NAME = 'sociowire-v4'; const PRECACHE = [ - '/', - '/index.html', '/icons/icon-192x192.png', '/icons/icon-512x512.png', '/icons/apple-touch-icon.png', @@ -36,12 +34,7 @@ self.addEventListener('fetch', event => { if (event.request.mode === 'navigate') { event.respondWith( fetch(event.request) - .then(response => { - const copy = response.clone(); - caches.open(CACHE_NAME).then(cache => cache.put('/index.html', copy)); - return response; - }) - .catch(() => caches.match('/index.html')) + .catch(() => caches.match('/')) ); return; }