Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4ba7a2219 | ||
|
|
25e42e3af5 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "litek",
|
"name": "litek",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.21",
|
"version": "0.0.22",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ export default defineConfig({
|
|||||||
runtimeCaching: [
|
runtimeCaching: [
|
||||||
{
|
{
|
||||||
urlPattern: /^https:\/\/ipinfo\.io\/.*/i,
|
urlPattern: /^https:\/\/ipinfo\.io\/.*/i,
|
||||||
handler: 'NetworkFirst',
|
handler: 'CacheFirst', // 改为 CacheFirst,优先使用缓存
|
||||||
options: {
|
options: {
|
||||||
cacheName: 'ipinfo-cache',
|
cacheName: 'ipinfo-cache',
|
||||||
expiration: {
|
expiration: {
|
||||||
maxEntries: 10,
|
maxEntries: 10,
|
||||||
maxAgeSeconds: 60 * 5 // 5 分钟
|
maxAgeSeconds: 60 * 60 // 延长到 1 小时
|
||||||
},
|
},
|
||||||
cacheableResponse: {
|
cacheableResponse: {
|
||||||
statuses: [0, 200]
|
statuses: [0, 200]
|
||||||
|
|||||||
Reference in New Issue
Block a user