From c98daf4b763f04d6994cab027d8626c58059b6ab Mon Sep 17 00:00:00 2001 From: Ugo Finnendahl Date: Sun, 3 Nov 2024 15:18:11 +0100 Subject: [PATCH] remove api from cache --- sw.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sw.js b/sw.js index 8c3ca41..37bb6e5 100644 --- a/sw.js +++ b/sw.js @@ -14,8 +14,8 @@ // Names of the two caches used in this version of the service worker. // Change to v2, etc. when you update any of the local resources, which will // in turn trigger the install event again. -const PRECACHE = 'precache-v2'; -const RUNTIME = 'runtime-v2'; +const PRECACHE = 'precache-v3'; +const RUNTIME = 'runtime-v3'; const cacheOn = true; // A list of local resources we always want to be cached. @@ -51,7 +51,7 @@ self.addEventListener('activate', event => { // from the network before returning it to the page. self.addEventListener('fetch', event => { // Skip cross-origin requests, like those for Google Analytics. - if (event.request.url.startsWith(self.location.origin) && !event.request.url.includes("panel") && event.request.method === "GET" && cacheOn) { + if (event.request.url.startsWith(self.location.origin) && !event.request.url.includes("panel") && !event.request.url.includes("api") && event.request.method === "GET" && cacheOn) { event.respondWith( caches.match(event.request).then(cachedResponse => { if (cachedResponse) {