Michael Wang 6 роки тому
батько
коміт
8a91501a77
1 змінених файлів з 3 додано та 7 видалено
  1. 3 7
      vue.config.js

+ 3 - 7
vue.config.js

@@ -81,12 +81,11 @@ module.exports = {
       clientsClaim: true,
       runtimeCaching: [
         {
-          // Match any same-origin request that contains 'api'.
+          // 背景图如果要换,就改地址,减少网络消耗
           urlPattern: new RegExp(
             "^https://cdn.qmth.com.cn/ui/ecs-client-bg.jpg!/progressive/true"
           ),
-          // Apply a network-first strategy.
-          handler: "staleWhileRevalidate",
+          handler: "cacheFirst",
           options: {
             cacheableResponse: {
               statuses: [0, 200],
@@ -95,20 +94,17 @@ module.exports = {
         },
         {
           // Match any same-origin request that contains 'api'.
+          // logo 可能每次都有更新
           urlPattern: /\/api\/ecs_core\/org\/propertyNoSession\/OE_STUDENT_SYS_NAME\?domainName=/,
-          // Apply a network-first strategy.
           handler: "staleWhileRevalidate",
         },
         {
           // Match any same-origin request that contains 'api'.
           urlPattern: /\/api\/ecs_core\/org\/logo\?domain=/,
-          // Apply a network-first strategy.
           handler: "staleWhileRevalidate",
         },
         {
-          // Match any same-origin request that contains 'api'.
           urlPattern: /\/models\/.*\.json/,
-          // Apply a network-first strategy.
           handler: "cacheFirst",
           options: {
             cacheableResponse: {