This commit is contained in:
186526 2022-04-30 11:10:50 +08:00
parent dc6436d839
commit 9a004d1b02
Signed by: 186526
GPG Key ID: C7EB1E6B8CC5E51D
1 changed files with 14 additions and 3 deletions

View File

@ -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',
}),
);
}