added features and fixes
This commit is contained in:
+4
-1
@@ -1,6 +1,6 @@
|
||||
// ponytail: bump CACHE_NAME on each deploy, or stale HTML breaks assets.
|
||||
// Network-first for navigation (index.html) keeps hashed asset refs fresh.
|
||||
const CACHE_NAME = 'dumpster-v2';
|
||||
const CACHE_NAME = 'dumpster-v3';
|
||||
|
||||
self.addEventListener('install', () => {
|
||||
self.skipWaiting();
|
||||
@@ -22,6 +22,9 @@ self.addEventListener('fetch', (event) => {
|
||||
// Skip API + WS
|
||||
if (url.pathname.startsWith('/api/') || url.pathname.startsWith('/ws')) return;
|
||||
|
||||
// Skip cross-origin requests (e.g. Giphy, LiveKit)
|
||||
if (url.origin !== self.location.origin) return;
|
||||
|
||||
// Network-first for navigation requests (index.html) — always fetch fresh HTML
|
||||
// so hashed asset references stay current after deploys.
|
||||
if (event.request.mode === 'navigate') {
|
||||
|
||||
Reference in New Issue
Block a user