mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 14:50:25 +08:00
缓存条件增加If-None-Match和If-Modified-Since是否回源选项
This commit is contained in:
@@ -21,6 +21,8 @@ Vue.component("http-cache-ref-box", {
|
||||
conds: null,
|
||||
allowChunkedEncoding: true,
|
||||
allowPartialContent: false,
|
||||
enableIfNoneMatch: false,
|
||||
enableIfModifiedSince: false,
|
||||
isReverse: this.vIsReverse,
|
||||
methods: [],
|
||||
expiresTime: {
|
||||
@@ -192,5 +194,19 @@ Vue.component("http-cache-ref-box", {
|
||||
<p class="comment">选中后,当请求的Header中含有Pragma: no-cache或Cache-Control: no-cache时,会跳过缓存直接读取源内容。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<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>
|
||||
</tbody>`
|
||||
})
|
||||
@@ -53,6 +53,8 @@ Vue.component("http-cache-refs-box", {
|
||||
<grey-label v-if="cacheRef.expiresTime != null && cacheRef.expiresTime.isPrior && cacheRef.expiresTime.isOn">Expires</grey-label>
|
||||
<grey-label v-if="cacheRef.status != null && cacheRef.status.length > 0 && (cacheRef.status.length > 1 || cacheRef.status[0] != 200)">状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}}</grey-label>
|
||||
<grey-label v-if="cacheRef.allowPartialContent">区间缓存</grey-label>
|
||||
<grey-label v-if="cacheRef.enableIfNoneMatch">If-None-Match</grey-label>
|
||||
<grey-label v-if="cacheRef.enableIfModifiedSince">If-Modified-Since</grey-label>
|
||||
</td>
|
||||
<td :class="{disabled: !cacheRef.isOn}">
|
||||
<span v-if="cacheRef.conds.connector == 'and'">和</span>
|
||||
|
||||
@@ -196,6 +196,8 @@ Vue.component("http-cache-refs-config-box", {
|
||||
<grey-label v-if="cacheRef.expiresTime != null && cacheRef.expiresTime.isPrior && cacheRef.expiresTime.isOn">Expires</grey-label>
|
||||
<grey-label v-if="cacheRef.status != null && cacheRef.status.length > 0 && (cacheRef.status.length > 1 || cacheRef.status[0] != 200)">状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}}</grey-label>
|
||||
<grey-label v-if="cacheRef.allowPartialContent">区间缓存</grey-label>
|
||||
<grey-label v-if="cacheRef.enableIfNoneMatch">If-None-Match</grey-label>
|
||||
<grey-label v-if="cacheRef.enableIfModifiedSince">If-Modified-Since</grey-label>
|
||||
</td>
|
||||
<td :class="{disabled: !cacheRef.isOn}">
|
||||
<span v-if="cacheRef.conds.connector == 'and'">和</span>
|
||||
|
||||
@@ -85,7 +85,8 @@ Vue.component("origin-list-table", {
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="origin in vOrigins">
|
||||
<td :class="{disabled:!origin.isOn}"><a href="" @click.prevent="updateOrigin(origin.id)">{{origin.addr}} <i class="icon expand small"></i></a>
|
||||
<td :class="{disabled:!origin.isOn}">
|
||||
<a href="" @click.prevent="updateOrigin(origin.id)" :class="{disabled:!origin.isOn}">{{origin.addr}} <i class="icon expand small"></i></a>
|
||||
<div style="margin-top: 0.3em" v-if="origin.name.length > 0 || origin.hasCert || (origin.host != null && origin.host.length > 0) || origin.followPort || (origin.domains != null && origin.domains.length > 0)">
|
||||
<tiny-basic-label v-if="origin.name.length > 0">{{origin.name}}</tiny-basic-label>
|
||||
<tiny-basic-label v-if="origin.hasCert">证书</tiny-basic-label>
|
||||
|
||||
Reference in New Issue
Block a user