diff --git a/includes/version.php b/includes/version.php index d5d7752..ee4e48b 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/service-worker.js b/service-worker.js index 7b1d2ca..8fb587b 100644 --- a/service-worker.js +++ b/service-worker.js @@ -99,10 +99,19 @@ self.addEventListener('install', function(event) { ); }); - self.addEventListener('fetch', function(event) { event.respondWith( - fetch(event.request, { redirect: 'follow' }).catch(function() { + fetch(event.request.clone()).then(function(response) { + // Check if the response is a redirect + if (response.redirected) { + // If the response is a redirect, follow it by making a new fetch request + return fetch(response.url); + } else { + // If the response is not a redirect, return it as-is + return response; + } + }).catch(function(error) { + // If fetching fails, try to retrieve the response from cache return caches.match(event.request); }) );