Fix PDFs still failing on browsers that used the old build #5

Merged
reudy merged 1 commit from sw-bypass-http-cache into main 2026-09-27 12:18:04 +02:00

View file

@ -16,7 +16,9 @@ sw.addEventListener('install', (event) => {
event.waitUntil(
caches
.open(CACHE)
.then((c) => c.addAll(ASSETS))
// Bypass the HTTP cache: hashed assets are cached as immutable, so a bad
// response (e.g. a wrong MIME type) would otherwise be copied in forever.
.then((c) => c.addAll(ASSETS.map((url) => new Request(url, { cache: 'reload' }))))
.then(() => sw.skipWaiting())
);
});