mirror of https://github.com/Nofated095/blog
update sw.js
This commit is contained in:
parent
3419083382
commit
e758ad7822
24
source/sw.js
24
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
|
||||
|
|
Loading…
Reference in New Issue