차량 모니터 에셋 갱신 보강

This commit is contained in:
seo
2026-07-21 19:15:34 +09:00
parent f25de4dcfb
commit cf2c90e4ce
4 changed files with 125 additions and 31 deletions
+2 -20
View File
@@ -1,10 +1,5 @@
const CACHE_NAME = 'car-monitor-v2';
const CACHE_NAME = 'car-monitor-nocache-v20260721';
const CORE_ASSETS = [
'/car/assets/favicon.svg',
'/car/assets/icon-192.png',
'/car/assets/icon-512.png',
'/car/assets/apple-touch-icon.png',
'/car/assets/site.webmanifest'
];
self.addEventListener('install', event => {
@@ -32,18 +27,5 @@ self.addEventListener('fetch', event => {
return;
}
if (event.request.mode === 'navigate' || url.pathname.endsWith('.php') || url.searchParams.has('mode')) {
return;
}
event.respondWith(
fetch(event.request)
.then(response => {
if (!response || !response.ok) return response;
const copy = response.clone();
caches.open(CACHE_NAME).then(cache => cache.put(event.request, copy));
return response;
})
.catch(() => caches.match(event.request))
);
event.respondWith(fetch(event.request, { cache: 'no-store' }));
});