Update
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-04-30 21:12:41 +08:00
parent 1137c36987
commit 9bc4b7c43e
10 changed files with 612 additions and 519 deletions

View File

@ -1,22 +1,22 @@
{
"name": "It's me, 186526!",
"short_name": "186526.xyz",
"lang": "zh-CN",
"start_url": "/",
"display": "standalone",
"theme_color": "#2A2734",
"background_color": "#FBDBC4",
"icons": [
{
"src": "./maskable.png",
"sizes": "1269x1269",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "./avatar.webp",
"sizes": "512x512",
"type": "image/webp"
}
]
}
"name": "It's me, 186526!",
"short_name": "186526.xyz",
"lang": "zh-CN",
"start_url": "/",
"display": "standalone",
"theme_color": "#2A2734",
"background_color": "#FBDBC4",
"icons": [
{
"src": "./maskable.png",
"sizes": "1269x1269",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "./avatar.webp",
"sizes": "512x512",
"type": "image/webp"
}
]
}

View File

@ -1,60 +1,57 @@
importScripts(
'workbox/workbox-sw.js',
);
self.addEventListener('install', (e) => {
self.skipWaiting();
importScripts("workbox/workbox-sw.js");
self.addEventListener("install", (e) => {
self.skipWaiting();
});
if (workbox) {
workbox.core.setCacheNameDetails({
prefix: 'home-app',
suffix: '0.0.3',
precache: 'precache',
runtime: 'runtime',
});
workbox.routing.registerRoute(
/\/assets/,
new workbox.strategies.CacheFirst({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 24 * 60 * 60,
}),
],
cacheName: 'assets',
workbox.core.setCacheNameDetails({
prefix: "home-app",
suffix: "0.0.3",
precache: "precache",
runtime: "runtime",
});
workbox.routing.registerRoute(
/\/assets/,
new workbox.strategies.CacheFirst({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 24 * 60 * 60,
}),
);
workbox.routing.registerRoute(
'/manifest.json',
new workbox.strategies.StaleWhileRevalidate({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 7 * 24 * 60 * 60,
}),
],
cacheName: 'assets',
],
cacheName: "assets",
})
);
workbox.routing.registerRoute(
"/manifest.json",
new workbox.strategies.StaleWhileRevalidate({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 7 * 24 * 60 * 60,
}),
);
workbox.routing.registerRoute(
'/',
new workbox.strategies.StaleWhileRevalidate({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 60 * 60 * 24,
}),
],
cacheName: 'assets',
],
cacheName: "assets",
})
);
workbox.routing.registerRoute(
"/",
new workbox.strategies.StaleWhileRevalidate({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 60 * 60 * 24,
}),
);
workbox.routing.registerRoute(
/\**/,
new workbox.strategies.StaleWhileRevalidate({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 60 * 60 * 24,
}),
],
cacheName: 'assets',
],
cacheName: "assets",
})
);
workbox.routing.registerRoute(
/\**/,
new workbox.strategies.StaleWhileRevalidate({
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 60 * 60 * 24,
}),
);
],
cacheName: "assets",
})
);
}