|
@@ -94,14 +94,33 @@ module.exports = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
// Match any same-origin request that contains 'api'.
|
|
// Match any same-origin request that contains 'api'.
|
|
- // logo 可能每次都有更新
|
|
|
|
|
|
+ // 产品名称有可能每分钟都更新
|
|
urlPattern: /\/api\/ecs_core\/org\/propertyNoSession\/OE_STUDENT_SYS_NAME\?domainName=/,
|
|
urlPattern: /\/api\/ecs_core\/org\/propertyNoSession\/OE_STUDENT_SYS_NAME\?domainName=/,
|
|
- handler: "staleWhileRevalidate",
|
|
|
|
|
|
+ handler: "cacheFirst",
|
|
|
|
+ options: {
|
|
|
|
+ cacheableResponse: {
|
|
|
|
+ statuses: [0, 200],
|
|
|
|
+ },
|
|
|
|
+ cacheName: "sys-name-cache",
|
|
|
|
+ expiration: {
|
|
|
|
+ maxAgeSeconds: 60,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
// Match any same-origin request that contains 'api'.
|
|
// Match any same-origin request that contains 'api'.
|
|
|
|
+ // logo 每天更新一次
|
|
urlPattern: /\/api\/ecs_core\/org\/logo\?domain=/,
|
|
urlPattern: /\/api\/ecs_core\/org\/logo\?domain=/,
|
|
- handler: "staleWhileRevalidate",
|
|
|
|
|
|
+ handler: "cacheFirst",
|
|
|
|
+ options: {
|
|
|
|
+ cacheableResponse: {
|
|
|
|
+ statuses: [0, 200],
|
|
|
|
+ },
|
|
|
|
+ cacheName: "logo-cache",
|
|
|
|
+ expiration: {
|
|
|
|
+ maxAgeSeconds: 24 * 60 * 60,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
urlPattern: /\/models\/.*\.json/,
|
|
urlPattern: /\/models\/.*\.json/,
|