This commit is contained in:
fly_mc 2024-11-23 21:44:19 +08:00
parent 0145477c96
commit 600a978f22

View file

@ -20,7 +20,7 @@ async function cacheWithFallback(cache, paths) {
try {
await cache.add(new Request(path, { credentials: 'same-origin' }));
} catch (error) {
// eslint-disable-next-line no-empty
}
}
}
@ -66,7 +66,7 @@ globalThis.addEventListener('fetch', (ev) => {
if (response) return response;
return fetch(ev.request).then((response) => {
if (!response || response.status !== 200 || response.type !== 'basic') return response;
if (response.status !== 200 || response.type !== 'basic') return response;
const responseToCache = response.clone();
caches.open(STATIC_CACHE_NAME)
.then((cache) => {