서비스워커 자산 캐시 제거
This commit is contained in:
+5
-16
@@ -1,13 +1,6 @@
|
||||
const CACHE_NAME = 'financial-static-v1';
|
||||
const CACHE_NAME = 'financial-offline-v20260721-nocache1';
|
||||
const STATIC_ASSETS = [
|
||||
'/offline.html',
|
||||
'/assets/vendor/bootstrap.min.css',
|
||||
'/assets/vendor/bootstrap.bundle.min.js',
|
||||
'/assets/vendor/chart.umd.js',
|
||||
'/assets/app.css',
|
||||
'/assets/pwa.js',
|
||||
'/favicon.png?v=2',
|
||||
'/manifest.webmanifest'
|
||||
'/offline.html'
|
||||
];
|
||||
|
||||
self.addEventListener('install', event => {
|
||||
@@ -45,16 +38,12 @@ self.addEventListener('fetch', event => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (url.pathname.startsWith('/assets/vendor/') || url.pathname === '/assets/app.css' || url.pathname === '/assets/pwa.js' || url.pathname === '/manifest.webmanifest' || url.pathname === '/favicon.png') {
|
||||
if (request.mode === 'navigate') {
|
||||
event.respondWith(
|
||||
caches.match(request).then(cached => cached || fetch(request))
|
||||
fetch(request, { cache: 'no-store' }).catch(() => caches.match('/offline.html'))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (request.mode === 'navigate') {
|
||||
event.respondWith(
|
||||
fetch(request).catch(() => caches.match('/offline.html'))
|
||||
);
|
||||
}
|
||||
event.respondWith(fetch(request, { cache: 'no-store' }));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user