diff --git a/vite.config.js b/vite.config.js index e611dc0..6071373 100644 --- a/vite.config.js +++ b/vite.config.js @@ -56,13 +56,41 @@ const manifestForPWAPlugIn = { }, }, }, + { + urlPattern: /^https:\/\/oss-accelerate\.aliyuncs\.com\/.*/i, + handler: 'CacheFirst', + options: { + cacheName: 'oss-ap-acc-media', + expiration: { + maxEntries: 50, + maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days + }, + cacheableResponse: { + statuses: [0, 200], + }, + }, + }, + { + urlPattern: /^https:\/\/page-spy\.mycht\.cn\/.*/i, + handler: 'CacheFirst', + options: { + cacheName: 'pagespy', + expiration: { + maxEntries: 10, + maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days + }, + cacheableResponse: { + statuses: [0, 200], + }, + }, + }, { urlPattern: /^https:\/\/static-legacy\.dingtalk.com\/.*/i, handler: 'CacheFirst', options: { cacheName: 'dingtalk-avatar-media', expiration: { - maxEntries: 50, + maxEntries: 10, maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days }, cacheableResponse: {