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:
@@ -32,7 +32,7 @@ export default defineConfig({
|
|||||||
runtimeCaching: [
|
runtimeCaching: [
|
||||||
{
|
{
|
||||||
urlPattern: /^https:\/\/ipinfo\.io\/.*/i,
|
urlPattern: /^https:\/\/ipinfo\.io\/.*/i,
|
||||||
handler: 'CacheFirst', // 改为 CacheFirst,优先使用缓存
|
handler: "NetworkFirst",
|
||||||
options: {
|
options: {
|
||||||
cacheName: 'ipinfo-cache',
|
cacheName: 'ipinfo-cache',
|
||||||
expiration: {
|
expiration: {
|
||||||
|
|||||||
Reference in New Issue
Block a user