From 2263d16c427d1dde002878dcc789008b9d6362d2 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 27 May 2024 15:13:03 +0800 Subject: [PATCH] =?UTF-8?q?conf:=20workbox=E5=8A=A8=E6=80=81=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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: {