mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 00:36:41 +08:00
更新vite.config.ts,增加页面缓存配置
This commit is contained in:
+14
-3
@@ -67,14 +67,24 @@ export default defineConfig({
|
|||||||
options: {
|
options: {
|
||||||
cacheName: 'image-cache',
|
cacheName: 'image-cache',
|
||||||
expiration: {
|
expiration: {
|
||||||
maxEntries: 50,
|
maxEntries: 100,
|
||||||
maxAgeSeconds: 30 * 24 * 60 * 60, // 缓存 30 天
|
maxAgeSeconds: 30 * 24 * 60 * 60,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
urlPattern: ({ request }) => request.destination === 'document',
|
||||||
|
handler: 'NetworkFirst',
|
||||||
|
options: {
|
||||||
|
cacheName: 'pages-cache',
|
||||||
|
networkTimeoutSeconds: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
navigateFallback: '/index.html', // 确保页面路由正确加载
|
navigateFallback: '/index.html',
|
||||||
navigateFallbackDenylist: [/.*\/api\/v\d+\/system\/logging.*/],
|
navigateFallbackDenylist: [/.*\/api\/v\d+\/system\/logging.*/],
|
||||||
|
skipWaiting: true,
|
||||||
|
clientsClaim: true,
|
||||||
},
|
},
|
||||||
injectManifest: {
|
injectManifest: {
|
||||||
rollupFormat: 'iife',
|
rollupFormat: 'iife',
|
||||||
@@ -131,6 +141,7 @@ export default defineConfig({
|
|||||||
'client_mode': 'navigate-existing',
|
'client_mode': 'navigate-existing',
|
||||||
},
|
},
|
||||||
'handle_links': 'preferred',
|
'handle_links': 'preferred',
|
||||||
|
'id': 'moviepilot-app',
|
||||||
'shortcuts': [
|
'shortcuts': [
|
||||||
{
|
{
|
||||||
'name': '推荐',
|
'name': '推荐',
|
||||||
|
|||||||
Reference in New Issue
Block a user