缓存条件增加最小内容尺寸配置

This commit is contained in:
刘祥超
2021-09-26 15:01:52 +08:00
parent f86548e046
commit f14dcd5c28
4 changed files with 32 additions and 5 deletions

View File

@@ -11,6 +11,7 @@ Vue.component("http-cache-ref-box", {
life: {count: 2, unit: "hour"},
status: [200],
maxSize: {count: 32, unit: "mb"},
minSize: {count: 0, unit: "kb"},
skipCacheControlValues: ["private", "no-cache", "no-store"],
skipSetCookie: true,
enableRequestCachePragma: false,
@@ -25,6 +26,9 @@ Vue.component("http-cache-ref-box", {
if (ref.maxSize == null) {
ref.maxSize = {count: 32, unit: "mb"}
}
if (ref.minSize == null) {
ref.minSize = {count: 0, unit: "kb"}
}
return {
ref: ref,
moreOptionsVisible: false
@@ -40,6 +44,9 @@ Vue.component("http-cache-ref-box", {
changeMaxSize: function (v) {
this.ref.maxSize = v
},
changeMinSize: function (v) {
this.ref.minSize = v
},
changeConds: function (v) {
this.ref.conds = v
},
@@ -81,9 +88,17 @@ Vue.component("http-cache-ref-box", {
<td colspan="2"><more-options-indicator @change="changeOptionsVisible"></more-options-indicator></td>
</tr>
<tr v-show="moreOptionsVisible && !vIsReverse">
<td>可缓存的最大文件</td>
<td>可缓存的最大内容尺寸</td>
<td>
<size-capacity-box :v-value="ref.maxSize" @change="changeMaxSize"></size-capacity-box>
<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>
</td>
</tr>
<tr v-show="moreOptionsVisible && !vIsReverse">