IgnoreVary now
continuous-integration/drone/push Build is passing Details

This commit is contained in:
DutchEllie 2022-07-04 21:35:05 +02:00
parent ff74a02c42
commit 8c1ede7b0f
Signed by: DutchEllie
SSH Key Fingerprint: SHA256:dKq6ZSgN5E3Viqrw/+xAdf2VdR6hdRGNyrYqXXwfjTY
1 changed files with 4 additions and 3 deletions

View File

@ -100,9 +100,10 @@ worker.addEventListener("fetch", (event) => {
const url = new URL(event.request.url);
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.
// 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.
const cachedAsset = isStaticAsset && (await caches.match(event.request));
const cachedAsset = isStaticAsset && (await caches.match(event.request, {ignoreVary: true}));
return cachedAsset || fetchAndCache(event.request);
})()