移除 vite.config.ts 中的缓存键处理逻辑以提高代码简洁性

This commit is contained in:
jxxghp
2025-07-10 16:50:35 +08:00
parent 308a951f78
commit a8eaf3b995

View File

@@ -138,13 +138,6 @@ export default defineConfig({
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'pages-cache',
cacheKeyWillBeUsed: async ({ request }) => {
// 忽略状态参数,提高缓存命中率
const url = new URL(request.url)
url.searchParams.delete('restored')
url.searchParams.delete('t')
return url.toString()
},
},
},
],