Volk Überarbeittung und Englisch Varaiblen ersetzt
This commit is contained in:
1 parent
9282777ac9
commit
8520678a48
11 files changed
+231
-104
No files matched your search
@@ -1,4 +1,4 @@
|
||||
const CACHE_NAME = "apicore-shell-v1";
|
||||
const CACHE_NAME = "apicore-shell-v2";
|
||||
|
||||
self.addEventListener("install", () => {
|
||||
self.skipWaiting();
|
||||
@@ -27,12 +27,22 @@ self.addEventListener("fetch", (event) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Page navigations must never be answered with a synthetic Response.error() -
|
||||
// Chrome/Edge render that as a native "This page couldn't load" interstitial
|
||||
// instead of the app. Let the browser handle navigations directly; only
|
||||
// static assets (JS/CSS/images) go through the offline-cache fallback below.
|
||||
if (request.mode === "navigate") {
|
||||
return;
|
||||
}
|
||||
|
||||
event.respondWith(
|
||||
fetch(request)
|
||||
.then((response) => {
|
||||
const responseClone = response.clone();
|
||||
caches.open(CACHE_NAME).then((cache) => cache.put(request, responseClone));
|
||||
return response;
|
||||
return caches
|
||||
.open(CACHE_NAME)
|
||||
.then((cache) => cache.put(request, responseClone))
|
||||
.then(() => response);
|
||||
})
|
||||
.catch(() => caches.match(request).then((cached) => cached || Response.error())),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user