fix(sw): bypass service worker entirely for /locales/ paths

This commit is contained in:
TheFlow 2025-10-26 15:54:53 +13:00
parent 6f7384b98b
commit 7e2d2c3dfa

View file

@ -68,13 +68,9 @@ self.addEventListener('fetch', (event) => {
return; return;
} }
// NEVER CACHE: Admin files, API calls - always fetch fresh, never cache // NEVER CACHE: Admin files, API calls, translations - bypass service worker entirely
if (NEVER_CACHE_PATHS.some(path => url.pathname.startsWith(path))) { if (NEVER_CACHE_PATHS.some(path => url.pathname.startsWith(path))) {
event.respondWith( // Don't intercept at all - let browser handle it directly
fetch(request).catch(() => {
throw new Error('Network required for admin/API resources');
})
);
return; return;
} }