Parcourir la source

因为考试时长肯定超过10分钟,所以客观分列表缓存10分钟

Michael Wang il y a 6 ans
Parent
commit
4895b18996
1 fichiers modifiés avec 15 ajouts et 0 suppressions
  1. 15 0
      vue.config.js

+ 15 - 0
vue.config.js

@@ -131,6 +131,21 @@ module.exports = {
             },
           },
         },
+        {
+          // Match any same-origin request that contains 'api'.
+          // 产品名称有可能每分钟都更新
+          urlPattern: /\/api\/ecs_oe_student\/examScore\/queryObjectiveScoreList\?examStudentId=/,
+          handler: "cacheFirst",
+          options: {
+            cacheableResponse: {
+              statuses: [0, 200],
+            },
+            cacheName: "objective-score-list-cache",
+            expiration: {
+              maxAgeSeconds: 10 * 60,
+            },
+          },
+        },
       ],
     },
   },