fix(config): phase 7 follow-up — fix remaining /ims/ occurrences in sw.js, notifications, components
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -16,20 +16,20 @@ self.addEventListener('activate', event => {
|
||||
self.addEventListener('fetch', event => {
|
||||
const url = new URL(event.request.url)
|
||||
|
||||
// Only handle same-origin GET requests under /ims/
|
||||
// Only handle same-origin GET requests
|
||||
if (
|
||||
event.request.method !== 'GET' ||
|
||||
url.origin !== self.location.origin ||
|
||||
!url.pathname.startsWith('/ims/')
|
||||
!url.pathname.startsWith('/')
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
// Skip API routes — always go to network
|
||||
if (url.pathname.startsWith('/ims/api/')) return
|
||||
if (url.pathname.startsWith('/api/')) return
|
||||
|
||||
// Cache-first for immutable Next.js static assets
|
||||
if (url.pathname.startsWith('/ims/_next/static/')) {
|
||||
if (url.pathname.startsWith('/_next/static/')) {
|
||||
event.respondWith(
|
||||
caches.match(event.request).then(cached => {
|
||||
if (cached) return cached
|
||||
|
||||
Reference in New Issue
Block a user