diff --git a/www/public/sw.js b/www/public/sw.js index e6b548c..6aaad6e 100644 --- a/www/public/sw.js +++ b/www/public/sw.js @@ -18,37 +18,4 @@ self.addEventListener('install', async (event) => { caches.open(CACHE) .then((cache) => cache.add(offlineFallbackPage)) ); -}); - -if (workbox.navigationPreload.isSupported()) { - workbox.navigationPreload.enable(); -} - -workbox.routing.registerRoute( - new RegExp('/*'), - new workbox.strategies.StaleWhileRevalidate({ - cacheName: CACHE - }) -); - -self.addEventListener('fetch', (event) => { - if (event.request.mode === 'navigate') { - event.respondWith((async () => { - try { - const preloadResp = await event.preloadResponse; - - if (preloadResp) { - return preloadResp; - } - - const networkResp = await fetch(event.request); - return networkResp; - } catch (error) { - - const cache = await caches.open(CACHE); - const cachedResp = await cache.match(offlineFallbackPage); - return cachedResp; - } - })()); - } }); \ No newline at end of file diff --git a/www/templates/footer.html.twig b/www/templates/footer.html.twig index e029a14..c6b538d 100644 --- a/www/templates/footer.html.twig +++ b/www/templates/footer.html.twig @@ -52,16 +52,14 @@ function geoFindMe() { \ No newline at end of file