diff --git a/sw.js b/sw.js index c281380..78d7edd 100644 --- a/sw.js +++ b/sw.js @@ -6,41 +6,41 @@ if(workbox) { self.skipWaiting(); workbox.core.clientsClaim(); - // workbox.routing.registerRoute( - // /\.(?:png|gif|jpg|jpeg|svg|webp|avif|gif)$/, - // new workbox.strategies.CacheFirst({ - // cacheName: 'images-cache', - // plugins: [ - // new workbox.expiration.ExpirationPlugin({ - // maxEntries: 600, - // maxAgeSeconds: 365 * 24 * 60 * 60, - // }), - // ], - // }) - // ); - // workbox.routing.registerRoute( - // /.*resources\/(semag|sppa).*/, - // new workbox.strategies.CacheFirst({ - // cacheName: 'resources-cache', - // plugins: [ - // new workbox.expiration.ExpirationPlugin({ - // maxEntries: 100, - // maxAgeSeconds: 365 * 24 * 60 * 60, - // }), - // ], - // }) - // ); + workbox.routing.registerRoute( + /\.(?:png|gif|jpg|jpeg|svg|webp|avif|gif)$/, + new workbox.strategies.CacheFirst({ + cacheName: 'images-cache', + plugins: [ + new workbox.expiration.ExpirationPlugin({ + maxEntries: 600, + maxAgeSeconds: 365 * 24 * 60 * 60, + }), + ], + }) + ); + workbox.routing.registerRoute( + /.*resources\/(semag|sppa).*/, + new workbox.strategies.CacheFirst({ + cacheName: 'resources-cache', + plugins: [ + new workbox.expiration.ExpirationPlugin({ + maxEntries: 100, + maxAgeSeconds: 365 * 24 * 60 * 60, + }), + ], + }) + ); - // workbox.routing.registerRoute( - // /.*resources\/(games|apps)\.json$/, - // new workbox.strategies.StaleWhileRevalidate({ - // cacheName: 'json-cache', - // plugins: [ - // new workbox.expiration.ExpirationPlugin({ - // maxAgeSeconds: 3 * 60 * 60, - // maxEntries: 2, - // }), - // ], - // }) - // ); + workbox.routing.registerRoute( + /.*resources\/(games|apps)\.json$/, + new workbox.strategies.StaleWhileRevalidate({ + cacheName: 'json-cache', + plugins: [ + new workbox.expiration.ExpirationPlugin({ + maxAgeSeconds: 3 * 60 * 60, + maxEntries: 2, + }), + ], + }) + ); }; \ No newline at end of file