Merge pull request 'Fix PDFs still failing on browsers that used the old build' (#5) from sw-bypass-http-cache into main
Reviewed-on: https://git.srazka.com/reudy-net/Papure/pulls/5
This commit is contained in:
commit
964b3b1cdd
1 changed files with 3 additions and 1 deletions
|
|
@ -16,7 +16,9 @@ sw.addEventListener('install', (event) => {
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches
|
caches
|
||||||
.open(CACHE)
|
.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())
|
.then(() => sw.skipWaiting())
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue