fix(pwa): force service worker update v8 and auto-reload on fresh deploy

This commit is contained in:
khondokartowsif171
2026-09-05 06:18:42 +06:00
parent ceac217a98
commit 9b1ec81647
2 changed files with 16 additions and 3 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
const CACHE_NAME = 'opal-ai-v5-cache';
const CACHE_NAME = 'opal-ai-v8-cache';
self.addEventListener('install', (e) => {
self.skipWaiting();
@@ -15,6 +15,7 @@ self.addEventListener('activate', (e) => {
});
self.addEventListener('fetch', (e) => {
// Always fetch fresh network first, fallback to cache only if completely offline
e.respondWith(
fetch(e.request).catch(() => caches.match(e.request))
);