Fix link in docs, add 'localhost' and gitpod to non-caching version of serviceworkers

This commit is contained in:
Pieter Vander Vennet 2022-07-05 16:59:40 +02:00
parent 536840ba1c
commit 13579e6c97
3 changed files with 4 additions and 4 deletions

View file

@ -71,7 +71,7 @@ self.addEventListener('fetch',
event.respondWith(new Response(JSON.stringify({"service-worker-version": version})));
return
}
const shouldBeCached = origin.host === requestUrl.host && origin.host !== "127.0.0.1:1234"
const shouldBeCached = origin.host === requestUrl.host && origin.host !== "127.0.0.1:1234" && origin.host !== "localhost" && !origin.host.endsWith(".gitpod.io")
if (!shouldBeCached) {
console.log("Not intercepting ", requestUrl.toString(), origin.host, requestUrl.host)
// We return _without_ calling event.respondWith, which signals the browser that it'll have to handle it himself