This commit is contained in:
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
101
public/sw.js
101
public/sw.js
@ -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",
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user