diff --git a/public/sw.js b/public/sw.js index d5d22ae..f163342 100644 --- a/public/sw.js +++ b/public/sw.js @@ -8,7 +8,7 @@ self.addEventListener('install', (e) => { if (workbox) { workbox.core.setCacheNameDetails({ prefix: 'home-app', - suffix: '0.0.2', + suffix: '0.0.3', precache: 'precache', runtime: 'runtime', }); @@ -31,7 +31,7 @@ if (workbox) { maxAgeSeconds: 7 * 24 * 60 * 60, }), ], - cacheName: 'startpage_me', + cacheName: 'assets', }), ); workbox.routing.registerRoute( @@ -42,7 +42,18 @@ if (workbox) { maxAgeSeconds: 60 * 60 * 24, }), ], - cacheName: 'startpage_me', + cacheName: 'assets', + }), + ); + workbox.routing.registerRoute( + /\**/, + new workbox.strategies.StaleWhileRevalidate({ + plugins: [ + new workbox.expiration.Plugin({ + maxAgeSeconds: 60 * 60 * 24, + }), + ], + cacheName: 'assets', }), ); }