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 c47a5e23..66534069 100644 --- a/web/public/js/components/server/http-cache-config-box.js +++ b/web/public/js/components/server/http-cache-config-box.js @@ -7,7 +7,9 @@ Vue.component("http-cache-config-box", { isPrior: false, isOn: false, addStatusHeader: true, - cacheRefs: [] + cacheRefs: [], + purgeIsOn: false, + purgeKey: "" } } return { @@ -17,6 +19,16 @@ Vue.component("http-cache-config-box", { methods: { isOn: function () { return ((!this.vIsLocation && !this.vIsGroup) || this.cacheConfig.isPrior) && this.cacheConfig.isOn + }, + generatePurgeKey: function () { + let r = Math.random().toString() + Math.random().toString() + let s = r.replace(/0\./g, "") + .replace(/\./g, "") + let result = "" + for (let i = 0; i < s.length; i++) { + result += String.fromCharCode(parseInt(s.substring(i, i + 1)) + ((Math.random() < 0.5) ? "a" : "A").charCodeAt(0)) + } + this.cacheConfig.purgeKey = result } }, template: `
选中后自动在响应Header中增加
允许使用PURGE方法清除某个URL缓存。
+[随机生成]。需要在PURGE方法调用时加入