diff --git a/web/public/js/components.js b/web/public/js/components.js index 3e63f240..726cf2ef 100755 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -3477,6 +3477,9 @@ Vue.component("http-cache-config-box", { isOn: function () { return ((!this.vIsLocation && !this.vIsGroup) || this.cacheConfig.isPrior) && this.cacheConfig.isOn }, + isPlus: function () { + return Tea.Vue.teaIsPlus + }, generatePurgeKey: function () { let r = Math.random().toString() + Math.random().toString() let s = r.replace(/0\./g, "") @@ -3489,6 +3492,9 @@ Vue.component("http-cache-config-box", { }, showMoreOptions: function () { this.moreOptionsVisible = !this.moreOptionsVisible + }, + changeStale: function (stale) { + this.cacheConfig.stale = stale } }, template: `
@@ -3545,14 +3551,14 @@ Vue.component("http-cache-config-box", { - 允许PURGE + 允许PURGE

允许使用PURGE方法清除某个URL缓存。

- PURGE Key * + PURGE Key *

[随机生成]。需要在PURGE方法调用时加入Edge-Purge-Key: {{cacheConfig.purgeKey}} Header。只能包含字符、数字、下划线。

@@ -3561,7 +3567,12 @@ Vue.component("http-cache-config-box", { -
+
+

过时缓存策略

+ +
+ +

缓存条件

@@ -4587,6 +4598,68 @@ Vue.component("server-name-box", {
` }) +Vue.component("http-cache-stale-config", { + props: ["v-cache-stale-config"], + data: function () { + let config = this.vCacheStaleConfig + if (config == null) { + config = { + isPrior: false, + isOn: false, + status: [], + supportStaleIfErrorHeader: true, + life: { + count: 1, + unit: "day" + } + } + } + return { + config: config + } + }, + watch: { + config: { + deep: true, + handler: function () { + this.$emit("change", this.config) + } + } + }, + methods: {}, + template: ` + + + + + + + + + + + + + + + + + + +
启用过时缓存 + +

选中后,在更新缓存失败后会尝试读取过时的缓存。

+
有效期 + +

缓存在过期之后,仍然保留的时间。

+
状态码 +

在这些状态码出现时使用过时缓存,默认支持50x状态码。

+
支持stale-if-error + +

选中后,支持在Cache-Control中通过stale-if-error指定过时缓存有效期。

+
` +}) + // 域名列表 Vue.component("domains-box", { props: ["v-domains"], @@ -6694,7 +6767,7 @@ Vue.component("http-access-log-box", { template: `
[{{accessLog.node.name}}节点] [服务] - [{{accessLog.region}}] {{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] "{{accessLog.requestMethod}} {{accessLog.scheme}}://{{accessLog.host}}{{accessLog.requestURI}} {{accessLog.proto}}" {{accessLog.status}} cache hit waf {{accessLog.firewallActions}} - {{tag}} - 耗时:{{formatCost(accessLog.requestTime)}} ms   ({{accessLog.humanTime}}) + [{{accessLog.region}}] {{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] "{{accessLog.requestMethod}} {{accessLog.scheme}}://{{accessLog.host}}{{accessLog.requestURI}} {{accessLog.proto}}" {{accessLog.status}} cache {{accessLog.attrs['cache.status'].toLowerCase()}} waf {{accessLog.firewallActions}} - {{tag}} - 耗时:{{formatCost(accessLog.requestTime)}} ms   ({{accessLog.humanTime}})  
` }) diff --git a/web/public/js/components/server/http-cache-config-box.js b/web/public/js/components/server/http-cache-config-box.js index 88117d34..7a3aaa06 100644 --- a/web/public/js/components/server/http-cache-config-box.js +++ b/web/public/js/components/server/http-cache-config-box.js @@ -117,7 +117,7 @@ Vue.component("http-cache-config-box", {
-

陈旧缓存策略

+

过时缓存策略

diff --git a/web/public/js/components/server/http-cache-stale-config.js b/web/public/js/components/server/http-cache-stale-config.js index 4a5abdaf..3a5167c8 100644 --- a/web/public/js/components/server/http-cache-stale-config.js +++ b/web/public/js/components/server/http-cache-stale-config.js @@ -30,10 +30,10 @@ Vue.component("http-cache-stale-config", { template: ` - + @@ -46,14 +46,14 @@ Vue.component("http-cache-stale-config", { diff --git a/web/views/@default/@layout.html b/web/views/@default/@layout.html index 8a5ec53e..5b255ef7 100644 --- a/web/views/@default/@layout.html +++ b/web/views/@default/@layout.html @@ -122,8 +122,8 @@ 官网文档GitHub - + 提BugQQ讨论群:659832182   企业版 diff --git a/web/views/@default/servers/server/settings/fastcgi/createPopup.html b/web/views/@default/servers/server/settings/fastcgi/createPopup.html index 07c413df..d05a32ec 100644 --- a/web/views/@default/servers/server/settings/fastcgi/createPopup.html +++ b/web/views/@default/servers/server/settings/fastcgi/createPopup.html @@ -31,7 +31,7 @@ -

可以在参数值中使用一些变量点这里查看

+

可以在参数值中使用一些变量点这里查看

diff --git a/web/views/@default/servers/server/settings/fastcgi/updatePopup.html b/web/views/@default/servers/server/settings/fastcgi/updatePopup.html index efe78a3b..0a4e2875 100644 --- a/web/views/@default/servers/server/settings/fastcgi/updatePopup.html +++ b/web/views/@default/servers/server/settings/fastcgi/updatePopup.html @@ -32,7 +32,7 @@ -

可以在参数值中使用一些变量点这里查看

+

可以在参数值中使用一些变量点这里查看

diff --git a/web/views/@default/servers/server/settings/rewrite/createPopup.html b/web/views/@default/servers/server/settings/rewrite/createPopup.html index e3aa9b21..060fbc6e 100644 --- a/web/views/@default/servers/server/settings/rewrite/createPopup.html +++ b/web/views/@default/servers/server/settings/rewrite/createPopup.html @@ -8,14 +8,14 @@ @@ -49,7 +49,7 @@ diff --git a/web/views/@default/servers/server/settings/rewrite/updatePopup.html b/web/views/@default/servers/server/settings/rewrite/updatePopup.html index 34884aa3..1aa782c5 100644 --- a/web/views/@default/servers/server/settings/rewrite/updatePopup.html +++ b/web/views/@default/servers/server/settings/rewrite/updatePopup.html @@ -9,14 +9,14 @@ @@ -50,7 +50,7 @@
启用陈旧缓存启用过时缓存 -

选中后,在更新缓存失败后会尝试读取陈旧的缓存。

+

选中后,在更新缓存失败后会尝试读取过时的缓存。

状态码 -

在这些状态码出现时使用陈旧缓存,默认支持50x状态码。

+

在这些状态码出现时使用过时缓存,默认支持50x状态码。

支持stale-if-error -

选中后,支持在Cache-Control中通过stale-if-error指定陈旧缓存有效期。

+

选中后,支持在Cache-Control中通过stale-if-error指定过时缓存有效期。

匹配规则 * -

需要符合正则表达式规范,正则表达式语法 »

+

需要符合正则表达式规范,正则表达式语法 »

目标URL * -

URL中可以包含一些内置的变量,也可以是一个完整的URL,比如:http://example.com/hello。

+

URL中可以包含一些内置的变量,也可以是一个完整的URL,比如:http://example.com/hello。

代理主机名 -

如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项,用于修改被代理服务接收到的域名,默认和客户端请求的主机名一致,通常不必填写,支持请求变量

+

如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项,用于修改被代理服务接收到的域名,默认和客户端请求的主机名一致,通常不必填写,支持请求变量

匹配规则 * -

需要符合正则表达式规范,正则表达式语法 »

+

需要符合正则表达式规范,正则表达式语法 »

目标URL * -

URL中可以包含一些内置的变量,也可以是一个完整的URL,比如:http://example.com/hello。

+

URL中可以包含一些内置的变量,也可以是一个完整的URL,比如:http://example.com/hello。

代理主机名 -

如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项,用于修改被代理服务接收到的域名,默认和客户端请求的主机名一致,通常不必填写,支持请求变量

+

如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项,用于修改被代理服务接收到的域名,默认和客户端请求的主机名一致,通常不必填写,支持请求变量