fix: update caching strategy for ipinfo API in Vite config

- Changed caching handler from 'CacheFirst' to 'NetworkFirst' to prioritize network responses.
- This adjustment aims to improve data freshness while still utilizing caching effectively.
This commit is contained in:
typist
2025-10-29 09:34:59 +08:00
parent 10a167febd
commit 09f9e6588f

View File

@@ -32,7 +32,7 @@ export default defineConfig({
runtimeCaching: [
{
urlPattern: /^https:\/\/ipinfo\.io\/.*/i,
handler: 'CacheFirst', // 改为 CacheFirst优先使用缓存
handler: "NetworkFirst",
options: {
cacheName: 'ipinfo-cache',
expiration: {