From 8b3619214b38b214be915f2265815e14eb9360d6 Mon Sep 17 00:00:00 2001 From: Nofated095 Date: Sun, 26 Nov 2023 11:52:40 +0800 Subject: [PATCH] update sw.js --- source/js/sw.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/js/sw.js b/source/js/sw.js index 7f1227b..8c9877e 100644 --- a/source/js/sw.js +++ b/source/js/sw.js @@ -53,6 +53,23 @@ routing.registerRoute( }) ); +routing.registerRoute( + /.*blog\.nofated\.win/, + new CacheFirst({ + cacheName: 'static-immutable' + cacheSuffixVersion, + fetchOptions: { + mode: 'cors', + credentials: 'omit' + }, + plugins: [ + new ExpirationPlugin({ + maxAgeSeconds: 30 * 24 * 60 * 60, + purgeOnQuotaError: true + }) + ] + }) +); + routing.registerRoute( /.*xgjalbum\.oss-cn-hangzhou\.aliyuncs\.com/, new CacheFirst({