parent
ff74a02c42
commit
8c1ede7b0f
@ -100,9 +100,10 @@ worker.addEventListener("fetch", (event) => {
|
|||||||
const url = new URL(event.request.url);
|
const url = new URL(event.request.url);
|
||||||
const isStaticAsset = staticAssets.has(url.href);
|
const isStaticAsset = staticAssets.has(url.href);
|
||||||
|
|
||||||
const cachedAsset = isStaticAsset && (await caches.match(event.request));
|
|
||||||
|
|
||||||
return cachedAsset || (await fetch(event.request))
|
const cachedAsset = isStaticAsset && (await caches.match(event.request, {ignoreVary: true}));
|
||||||
|
|
||||||
|
return cachedAsset || (await fetch(event.request,))
|
||||||
})()
|
})()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -126,7 +127,7 @@ worker.addEventListener("fetch", (event) => {
|
|||||||
// always serve static files and bundler-generated assets from cache.
|
// always serve static files and bundler-generated assets from cache.
|
||||||
// if your application has other URLs with data that will never change,
|
// if your application has other URLs with data that will never change,
|
||||||
// set this variable to true for them, and they will only be fetched once.
|
// set this variable to true for them, and they will only be fetched once.
|
||||||
const cachedAsset = isStaticAsset && (await caches.match(event.request));
|
const cachedAsset = isStaticAsset && (await caches.match(event.request, {ignoreVary: true}));
|
||||||
|
|
||||||
return cachedAsset || fetchAndCache(event.request);
|
return cachedAsset || fetchAndCache(event.request);
|
||||||
})()
|
})()
|
||||||
|
Loading…
Reference in New Issue
Block a user