fix: dashboard fallback

This commit is contained in:
hamster1963 2024-12-05 10:26:02 +08:00
parent 9073fa6429
commit 3f53b9db80
2 changed files with 2 additions and 15 deletions

View File

@ -1,7 +1,7 @@
{
"name": "nazha-dashboard-vite",
"private": true,
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -54,6 +54,7 @@ export default defineConfig({
clientsClaim: true,
skipWaiting: true,
cleanupOutdatedCaches: true,
navigateFallbackDenylist: [/^\/dashboard/],
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
@ -83,20 +84,6 @@ export default defineConfig({
}
}
},
{
urlPattern: /^https:\/\/api\.nezha\.dev\/.*/i,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 5 // <== 5 minutes
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
},
devOptions: {