2021-06-08 22:46:08 +08:00
|
|
|
|
// 单个缓存条件设置
|
2020-10-04 20:38:27 +08:00
|
|
|
|
Vue.component("http-cache-ref-box", {
|
2021-06-08 22:46:08 +08:00
|
|
|
|
props: ["v-cache-ref", "v-is-reverse"],
|
2021-12-07 10:04:50 +08:00
|
|
|
|
mounted: function () {
|
|
|
|
|
|
this.$refs.variablesDescriber.update(this.ref.key)
|
2022-09-03 18:14:34 +08:00
|
|
|
|
if (this.ref.simpleCond != null) {
|
2022-09-03 19:15:30 +08:00
|
|
|
|
this.condType = this.ref.simpleCond.type
|
|
|
|
|
|
this.changeCondType(this.ref.simpleCond.type, true)
|
2022-09-03 18:14:34 +08:00
|
|
|
|
this.condCategory = "simple"
|
|
|
|
|
|
} else if (this.ref.conds != null && this.ref.conds.groups != null) {
|
|
|
|
|
|
this.condCategory = "complex"
|
|
|
|
|
|
}
|
2022-09-03 19:15:30 +08:00
|
|
|
|
this.changeCondCategory(this.condCategory)
|
2021-12-07 10:04:50 +08:00
|
|
|
|
},
|
2020-10-04 20:38:27 +08:00
|
|
|
|
data: function () {
|
|
|
|
|
|
let ref = this.vCacheRef
|
|
|
|
|
|
if (ref == null) {
|
|
|
|
|
|
ref = {
|
|
|
|
|
|
isOn: true,
|
|
|
|
|
|
cachePolicyId: 0,
|
2021-12-07 10:04:50 +08:00
|
|
|
|
key: "${scheme}://${host}${requestPath}${isArgs}${args}",
|
2023-08-14 10:42:36 +08:00
|
|
|
|
life: {count: 1, unit: "day"},
|
2020-10-04 20:38:27 +08:00
|
|
|
|
status: [200],
|
2023-08-07 11:32:59 +08:00
|
|
|
|
maxSize: {count: 128, unit: "mb"},
|
2021-09-26 15:01:52 +08:00
|
|
|
|
minSize: {count: 0, unit: "kb"},
|
2020-10-04 20:38:27 +08:00
|
|
|
|
skipCacheControlValues: ["private", "no-cache", "no-store"],
|
|
|
|
|
|
skipSetCookie: true,
|
|
|
|
|
|
enableRequestCachePragma: false,
|
2022-09-03 18:14:34 +08:00
|
|
|
|
conds: null, // 复杂条件
|
|
|
|
|
|
simpleCond: null, // 简单条件
|
2021-06-08 22:46:08 +08:00
|
|
|
|
allowChunkedEncoding: true,
|
2022-09-24 14:40:34 +08:00
|
|
|
|
allowPartialContent: true,
|
2023-06-15 15:15:11 +08:00
|
|
|
|
forcePartialContent: false,
|
2022-08-07 16:36:41 +08:00
|
|
|
|
enableIfNoneMatch: false,
|
|
|
|
|
|
enableIfModifiedSince: false,
|
2023-07-31 15:59:19 +08:00
|
|
|
|
enableReadingOriginAsync: false,
|
2021-12-07 10:45:49 +08:00
|
|
|
|
isReverse: this.vIsReverse,
|
2021-12-08 17:41:12 +08:00
|
|
|
|
methods: [],
|
|
|
|
|
|
expiresTime: {
|
|
|
|
|
|
isPrior: false,
|
|
|
|
|
|
isOn: false,
|
|
|
|
|
|
overwrite: true,
|
|
|
|
|
|
autoCalculate: true,
|
|
|
|
|
|
duration: {count: -1, "unit": "hour"}
|
|
|
|
|
|
}
|
2020-10-04 20:38:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-12-07 10:04:50 +08:00
|
|
|
|
if (ref.key == null) {
|
|
|
|
|
|
ref.key = ""
|
|
|
|
|
|
}
|
2021-12-07 10:45:49 +08:00
|
|
|
|
if (ref.methods == null) {
|
|
|
|
|
|
ref.methods = []
|
|
|
|
|
|
}
|
2021-12-07 10:04:50 +08:00
|
|
|
|
|
2020-10-04 20:38:27 +08:00
|
|
|
|
if (ref.life == null) {
|
|
|
|
|
|
ref.life = {count: 2, unit: "hour"}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (ref.maxSize == null) {
|
|
|
|
|
|
ref.maxSize = {count: 32, unit: "mb"}
|
|
|
|
|
|
}
|
2021-09-26 15:01:52 +08:00
|
|
|
|
if (ref.minSize == null) {
|
|
|
|
|
|
ref.minSize = {count: 0, unit: "kb"}
|
|
|
|
|
|
}
|
2022-09-03 18:14:34 +08:00
|
|
|
|
|
|
|
|
|
|
let condType = "url-extension"
|
|
|
|
|
|
let condComponent = window.REQUEST_COND_COMPONENTS.$find(function (k, v) {
|
|
|
|
|
|
return v.type == "url-extension"
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2020-10-04 20:38:27 +08:00
|
|
|
|
return {
|
|
|
|
|
|
ref: ref,
|
2022-09-24 15:13:35 +08:00
|
|
|
|
|
|
|
|
|
|
keyIgnoreArgs: typeof ref.key == "string" && ref.key.indexOf("${args}") < 0,
|
|
|
|
|
|
|
2022-09-03 18:14:34 +08:00
|
|
|
|
moreOptionsVisible: false,
|
2022-09-03 19:15:30 +08:00
|
|
|
|
|
2022-09-03 18:14:34 +08:00
|
|
|
|
condCategory: "simple", // 条件分类:simple|complex
|
|
|
|
|
|
condType: condType,
|
|
|
|
|
|
condComponent: condComponent,
|
2022-09-03 19:15:30 +08:00
|
|
|
|
condIsCaseInsensitive: (ref.simpleCond != null) ? ref.simpleCond.isCaseInsensitive : true,
|
|
|
|
|
|
|
2022-09-03 18:14:34 +08:00
|
|
|
|
components: window.REQUEST_COND_COMPONENTS
|
2020-10-04 20:38:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-09-24 15:13:35 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
keyIgnoreArgs: function (b) {
|
|
|
|
|
|
if (typeof this.ref.key != "string") {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
if (b) {
|
|
|
|
|
|
this.ref.key = this.ref.key.replace("${isArgs}${args}", "")
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.ref.key.indexOf("${isArgs}") < 0) {
|
|
|
|
|
|
this.ref.key = this.ref.key + "${isArgs}"
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.ref.key.indexOf("${args}") < 0) {
|
|
|
|
|
|
this.ref.key = this.ref.key + "${args}"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-10-04 20:38:27 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
changeOptionsVisible: function (v) {
|
|
|
|
|
|
this.moreOptionsVisible = v
|
|
|
|
|
|
},
|
|
|
|
|
|
changeLife: function (v) {
|
|
|
|
|
|
this.ref.life = v
|
|
|
|
|
|
},
|
|
|
|
|
|
changeMaxSize: function (v) {
|
|
|
|
|
|
this.ref.maxSize = v
|
|
|
|
|
|
},
|
2021-09-26 15:01:52 +08:00
|
|
|
|
changeMinSize: function (v) {
|
|
|
|
|
|
this.ref.minSize = v
|
|
|
|
|
|
},
|
2020-10-04 20:38:27 +08:00
|
|
|
|
changeConds: function (v) {
|
|
|
|
|
|
this.ref.conds = v
|
2022-09-03 18:14:34 +08:00
|
|
|
|
this.ref.simpleCond = null
|
2021-08-29 09:22:02 +08:00
|
|
|
|
},
|
|
|
|
|
|
changeStatusList: function (list) {
|
|
|
|
|
|
let result = []
|
|
|
|
|
|
list.forEach(function (status) {
|
|
|
|
|
|
let statusNumber = parseInt(status)
|
|
|
|
|
|
if (isNaN(statusNumber) || statusNumber < 100 || statusNumber > 999) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
result.push(statusNumber)
|
|
|
|
|
|
})
|
|
|
|
|
|
this.ref.status = result
|
2021-12-07 10:04:50 +08:00
|
|
|
|
},
|
2021-12-07 10:45:49 +08:00
|
|
|
|
changeMethods: function (methods) {
|
|
|
|
|
|
this.ref.methods = methods.map(function (v) {
|
|
|
|
|
|
return v.toUpperCase()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-12-07 10:04:50 +08:00
|
|
|
|
changeKey: function (key) {
|
|
|
|
|
|
this.$refs.variablesDescriber.update(key)
|
2021-12-08 17:41:12 +08:00
|
|
|
|
},
|
|
|
|
|
|
changeExpiresTime: function (expiresTime) {
|
|
|
|
|
|
this.ref.expiresTime = expiresTime
|
2022-09-03 18:14:34 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 切换条件类型
|
|
|
|
|
|
changeCondCategory: function (condCategory) {
|
|
|
|
|
|
this.condCategory = condCategory
|
2022-09-03 19:15:30 +08:00
|
|
|
|
|
|
|
|
|
|
// resize window
|
|
|
|
|
|
let dialog = window.parent.document.querySelector("*[role='dialog']")
|
2022-09-24 15:13:35 +08:00
|
|
|
|
if (dialog == null) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2022-09-03 19:15:30 +08:00
|
|
|
|
switch (condCategory) {
|
|
|
|
|
|
case "simple":
|
2023-07-31 17:31:42 +08:00
|
|
|
|
dialog.style.width = "45em"
|
2022-09-03 19:15:30 +08:00
|
|
|
|
break
|
|
|
|
|
|
case "complex":
|
|
|
|
|
|
let width = window.parent.innerWidth
|
|
|
|
|
|
if (width > 1024) {
|
|
|
|
|
|
width = 1024
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dialog.style.width = width + "px"
|
2023-12-19 09:26:18 +08:00
|
|
|
|
if (this.ref.conds != null) {
|
|
|
|
|
|
this.ref.conds.isOn = true
|
|
|
|
|
|
}
|
2022-09-03 19:15:30 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
2022-09-03 18:14:34 +08:00
|
|
|
|
},
|
2022-09-03 19:15:30 +08:00
|
|
|
|
changeCondType: function (condType, isInit) {
|
|
|
|
|
|
if (!isInit && this.ref.simpleCond != null) {
|
|
|
|
|
|
this.ref.simpleCond.value = null
|
|
|
|
|
|
}
|
2022-09-03 18:14:34 +08:00
|
|
|
|
let def = this.components.$find(function (k, component) {
|
|
|
|
|
|
return component.type == condType
|
|
|
|
|
|
})
|
|
|
|
|
|
if (def != null) {
|
|
|
|
|
|
this.condComponent = def
|
|
|
|
|
|
}
|
2020-10-04 20:38:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
template: `<tbody>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<tr v-if="condCategory == 'simple'">
|
2023-08-14 09:59:55 +08:00
|
|
|
|
<td class="title">缓存对象 *</td>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<td>
|
2022-09-03 19:15:30 +08:00
|
|
|
|
<select class="ui dropdown auto-width" name="condType" v-model="condType" @change="changeCondType(condType, false)">
|
2023-06-10 17:35:45 +08:00
|
|
|
|
<option value="url-extension">文件扩展名</option>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<option value="url-eq-index">首页</option>
|
2023-06-10 17:35:45 +08:00
|
|
|
|
<option value="url-all">全站</option>
|
2023-08-14 10:02:01 +08:00
|
|
|
|
<option value="url-prefix">URL目录前缀</option>
|
2022-09-03 19:15:30 +08:00
|
|
|
|
<option value="url-eq">URL完整路径</option>
|
2023-06-16 11:34:39 +08:00
|
|
|
|
<option value="url-wildcard-match">URL通配符</option>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<option value="url-regexp">URL正则匹配</option>
|
2022-09-03 19:25:08 +08:00
|
|
|
|
<option value="params">参数匹配</option>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
</select>
|
|
|
|
|
|
<p class="comment"><a href="" @click.prevent="changeCondCategory('complex')">切换到复杂条件 »</a></p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr v-if="condCategory == 'simple'">
|
2023-06-10 17:58:03 +08:00
|
|
|
|
<td>{{condComponent.paramsTitle}} *</td>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<td>
|
2023-02-13 09:44:10 +08:00
|
|
|
|
<component :is="condComponent.component" :v-cond="ref.simpleCond" v-if="condComponent.type != 'params'"></component>
|
|
|
|
|
|
<table class="ui table" v-if="condComponent.type == 'params'">
|
|
|
|
|
|
<component :is="condComponent.component" :v-cond="ref.simpleCond"></component>
|
|
|
|
|
|
</table>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2022-09-03 19:15:30 +08:00
|
|
|
|
<tr v-if="condCategory == 'simple' && condComponent.caseInsensitive">
|
2023-06-10 17:58:03 +08:00
|
|
|
|
<td>不区分大小写</td>
|
2022-09-03 19:15:30 +08:00
|
|
|
|
<td>
|
|
|
|
|
|
<div class="ui checkbox">
|
|
|
|
|
|
<input type="checkbox" name="condIsCaseInsensitive" value="1" v-model="condIsCaseInsensitive"/>
|
|
|
|
|
|
<label></label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p class="comment">选中后表示对比时忽略参数值的大小写。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<tr v-if="condCategory == 'complex'">
|
2021-05-12 15:07:30 +08:00
|
|
|
|
<td class="title">匹配条件分组 *</td>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>
|
|
|
|
|
|
<http-request-conds-box :v-conds="ref.conds" @change="changeConds"></http-request-conds-box>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<p class="comment"><a href="" @click.prevent="changeCondCategory('simple')">« 切换到简单条件</a></p>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-06-08 22:46:08 +08:00
|
|
|
|
<tr v-show="!vIsReverse">
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>缓存有效期 *</td>
|
|
|
|
|
|
<td>
|
2023-08-14 10:42:36 +08:00
|
|
|
|
<time-duration-box :v-value="ref.life" @change="changeLife" :v-min-unit="'minute'" maxlength="4"></time-duration-box>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-06-08 22:46:08 +08:00
|
|
|
|
<tr v-show="!vIsReverse">
|
2023-06-10 17:58:03 +08:00
|
|
|
|
<td>忽略URI参数</td>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>
|
2023-06-10 17:58:03 +08:00
|
|
|
|
<checkbox v-model="keyIgnoreArgs"></checkbox>
|
|
|
|
|
|
<p class="comment">选中后,表示缓存Key中不包含URI参数(即问号(?))后面的内容。</p>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2022-09-24 15:13:35 +08:00
|
|
|
|
<tr v-show="!vIsReverse">
|
2023-08-14 10:42:36 +08:00
|
|
|
|
<td colspan="2"><more-options-indicator @change="changeOptionsVisible"></more-options-indicator></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2023-06-10 17:58:03 +08:00
|
|
|
|
<td>缓存Key *</td>
|
2022-09-24 15:13:35 +08:00
|
|
|
|
<td>
|
2023-06-10 17:58:03 +08:00
|
|
|
|
<input type="text" v-model="ref.key" @input="changeKey(ref.key)"/>
|
|
|
|
|
|
<p class="comment">用来区分不同缓存内容的唯一Key。<request-variables-describer ref="variablesDescriber"></request-variables-describer>。</p>
|
2022-09-24 15:13:35 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-12-07 10:45:49 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2021-12-08 17:41:12 +08:00
|
|
|
|
<td>请求方法限制</td>
|
2021-12-07 10:45:49 +08:00
|
|
|
|
<td>
|
|
|
|
|
|
<values-box size="5" maxlength="10" :values="ref.methods" @change="changeMethods"></values-box>
|
2021-12-07 10:47:46 +08:00
|
|
|
|
<p class="comment">允许请求的缓存方法,默认支持所有的请求方法。</p>
|
2021-12-07 10:45:49 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-12-08 17:41:12 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
|
|
|
|
|
<td>客户端过期时间<em>(Expires)</em></td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<http-expires-time-config-box :v-expires-time="ref.expiresTime" @change="changeExpiresTime"></http-expires-time-config-box>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-06-08 22:46:08 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2021-09-26 15:01:52 +08:00
|
|
|
|
<td>可缓存的最大内容尺寸</td>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>
|
|
|
|
|
|
<size-capacity-box :v-value="ref.maxSize" @change="changeMaxSize"></size-capacity-box>
|
2021-09-26 15:01:52 +08:00
|
|
|
|
<p class="comment">内容尺寸如果高于此值则不缓存。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
|
|
|
|
|
<td>可缓存的最小内容尺寸</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<size-capacity-box :v-value="ref.minSize" @change="changeMinSize"></size-capacity-box>
|
|
|
|
|
|
<p class="comment">内容尺寸如果低于此值则不缓存。</p>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2022-03-03 19:32:11 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2023-07-31 17:11:42 +08:00
|
|
|
|
<td>支持缓存分片内容</td>
|
2022-03-03 19:32:11 +08:00
|
|
|
|
<td>
|
|
|
|
|
|
<checkbox name="allowPartialContent" value="1" v-model="ref.allowPartialContent"></checkbox>
|
2023-07-31 17:11:42 +08:00
|
|
|
|
<p class="comment">选中后,支持缓存源站返回的某个分片的内容,该内容通过<code-label>206 Partial Content</code-label>状态码返回。</p>
|
2021-04-18 22:16:46 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2023-07-31 17:31:42 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse && ref.allowPartialContent && !ref.alwaysForwardRangeReques">
|
2023-07-31 17:11:42 +08:00
|
|
|
|
<td>强制返回分片内容</td>
|
2023-06-15 15:15:11 +08:00
|
|
|
|
<td>
|
|
|
|
|
|
<checkbox name="forcePartialContent" value="1" v-model="ref.forcePartialContent"></checkbox>
|
2023-07-31 17:11:42 +08:00
|
|
|
|
<p class="comment">选中后,表示无论客户端是否发送<code-label>Range</code-label>报头,都会优先尝试返回已缓存的分片内容;如果你的应用有不支持分片内容的客户端(比如有些下载软件不支持<code-label>206 Partial Content</code-label>),请务必关闭此功能。</p>
|
2023-06-15 15:15:11 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2023-07-31 17:31:42 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
|
|
|
|
|
<td>强制Range回源</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<checkbox v-model="ref.alwaysForwardRangeRequest"></checkbox>
|
|
|
|
|
|
<p class="comment">选中后,表示把所有包含Range报头的请求都转发到源站,而不是尝试从缓存中读取。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-06-08 22:46:08 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>状态码列表</td>
|
|
|
|
|
|
<td>
|
2021-08-29 09:22:02 +08:00
|
|
|
|
<values-box name="statusList" size="3" maxlength="3" :values="ref.status" @change="changeStatusList"></values-box>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<p class="comment">允许缓存的HTTP状态码列表。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-06-08 22:46:08 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>跳过的Cache-Control值</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<values-box name="skipResponseCacheControlValues" size="10" maxlength="100" :values="ref.skipCacheControlValues"></values-box>
|
|
|
|
|
|
<p class="comment">当响应的Cache-Control为这些值时不缓存响应内容,而且不区分大小写。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-06-08 22:46:08 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>跳过Set-Cookie</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<div class="ui checkbox">
|
|
|
|
|
|
<input type="checkbox" value="1" v-model="ref.skipSetCookie"/>
|
|
|
|
|
|
<label></label>
|
|
|
|
|
|
</div>
|
2023-08-20 11:16:58 +08:00
|
|
|
|
<p class="comment">选中后,当响应的报头中有Set-Cookie时不缓存响应内容,防止动态内容被缓存。</p>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2021-06-08 22:46:08 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
2020-10-04 20:38:27 +08:00
|
|
|
|
<td>支持请求no-cache刷新</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<div class="ui checkbox">
|
|
|
|
|
|
<input type="checkbox" name="enableRequestCachePragma" value="1" v-model="ref.enableRequestCachePragma"/>
|
|
|
|
|
|
<label></label>
|
|
|
|
|
|
</div>
|
2023-08-20 11:16:58 +08:00
|
|
|
|
<p class="comment">选中后,当请求的报头中含有Pragma: no-cache或Cache-Control: no-cache时,会跳过缓存直接读取源内容,一般仅用于调试。</p>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2022-08-07 16:36:41 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
|
|
|
|
|
<td>允许If-None-Match回源</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<checkbox v-model="ref.enableIfNoneMatch"></checkbox>
|
|
|
|
|
|
<p class="comment">特殊情况下才需要开启,可能会降低缓存命中率。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
|
|
|
|
|
<td>允许If-Modified-Since回源</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<checkbox v-model="ref.enableIfModifiedSince"></checkbox>
|
|
|
|
|
|
<p class="comment">特殊情况下才需要开启,可能会降低缓存命中率。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2023-07-31 15:59:19 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
|
|
|
|
|
<td>允许异步读取源站</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<checkbox v-model="ref.enableReadingOriginAsync"></checkbox>
|
|
|
|
|
|
<p class="comment">试验功能。允许客户端中断连接后,仍然继续尝试从源站读取内容并缓存。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2023-07-31 17:31:42 +08:00
|
|
|
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
|
|
|
|
|
<td>支持分段内容</td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<checkbox name="allowChunkedEncoding" value="1" v-model="ref.allowChunkedEncoding"></checkbox>
|
|
|
|
|
|
<p class="comment">选中后,Gzip等压缩后的Chunked内容可以直接缓存,无需检查内容长度。</p>
|
|
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2022-09-03 18:14:34 +08:00
|
|
|
|
<tr v-show="false">
|
|
|
|
|
|
<td colspan="2"><input type="hidden" name="cacheRefJSON" :value="JSON.stringify(ref)"/></td>
|
|
|
|
|
|
</tr>
|
2020-10-04 20:38:27 +08:00
|
|
|
|
</tbody>`
|
|
|
|
|
|
})
|