fix: bust service worker cache on each build with version+timestamp
The SW cache name was hardcoded to 'pinchchat-v1', meaning PWA users would get stale cached assets forever. Now the cache name includes the package version and build timestamp, so each build creates a new cache and old ones are cleaned up on activation. Also adds: - Periodic SW update check (every 30 min) - Auto-reload when new SW version is detected
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// PinchChat Service Worker — cache static assets for offline/instant load
|
||||
const CACHE_NAME = 'pinchchat-v1';
|
||||
const CACHE_NAME = 'pinchchat-__SW_VERSION__';
|
||||
|
||||
// Cache static assets on install
|
||||
self.addEventListener('install', (event) => {
|
||||
|
||||
Reference in New Issue
Block a user