diff --git a/source/sw.js b/source/sw.js index 765608a..da530aa 100644 --- a/source/sw.js +++ b/source/sw.js @@ -104,6 +104,23 @@ routing.registerRoute( }) ); +routing.registerRoute( + /.*comment\.9595095\.xyz/, + new CacheFirst({ + cacheName: 'static-immutable' + cacheSuffixVersion, + fetchOptions: { + mode: 'cors', + credentials: 'omit' + }, + plugins: [ + new ExpirationPlugin({ + maxAgeSeconds: 30 * 24 * 60 * 60, + purgeOnQuotaError: true + }) + ] + }) +); + routing.registerRoute( /.*cdn\.jsdelivr\.net/, new CacheFirst({ @@ -215,6 +232,13 @@ routing.registerRoute( StaleWhileRevalidateInstance ); +routing.registerRoute( + // Cache CSS files + /.*\.(json)/, + // Use cache but update in the background ASAP + StaleWhileRevalidateInstance +); + /* * sw.js - Revalidate every time * staleWhileRevalidate