缓存条件增加是否允许异步读取源站选项

This commit is contained in:
刘祥超
2023-07-31 15:59:19 +08:00
parent 2393f3a701
commit b9837f526b
3 changed files with 12 additions and 18 deletions

View File

@@ -33,6 +33,7 @@ Vue.component("http-cache-ref-box", {
forcePartialContent: false, forcePartialContent: false,
enableIfNoneMatch: false, enableIfNoneMatch: false,
enableIfModifiedSince: false, enableIfModifiedSince: false,
enableReadingOriginAsync: false,
isReverse: this.vIsReverse, isReverse: this.vIsReverse,
methods: [], methods: [],
expiresTime: { expiresTime: {
@@ -335,6 +336,13 @@ Vue.component("http-cache-ref-box", {
<p class="comment">特殊情况下才需要开启,可能会降低缓存命中率。</p> <p class="comment">特殊情况下才需要开启,可能会降低缓存命中率。</p>
</td> </td>
</tr> </tr>
<tr v-show="moreOptionsVisible && !vIsReverse">
<td>允许异步读取源站</td>
<td>
<checkbox v-model="ref.enableReadingOriginAsync"></checkbox>
<p class="comment">试验功能。允许客户端中断连接后,仍然继续尝试从源站读取内容并缓存。</p>
</td>
</tr>
<tr v-show="false"> <tr v-show="false">
<td colspan="2"><input type="hidden" name="cacheRefJSON" :value="JSON.stringify(ref)"/></td> <td colspan="2"><input type="hidden" name="cacheRefJSON" :value="JSON.stringify(ref)"/></td>
</tr> </tr>

View File

@@ -38,8 +38,7 @@ Vue.component("http-cache-refs-box", {
<thead> <thead>
<tr> <tr>
<th>缓存条件</th> <th>缓存条件</th>
<th class="two wide">分组关系</th> <th class="width6">缓存时间</th>
<th class="width10">缓存时间</th>
</tr> </tr>
<tr v-for="(cacheRef, index) in refs"> <tr v-for="(cacheRef, index) in refs">
<td :class="{'color-border': cacheRef.conds != null && cacheRef.conds.connector == 'and', disabled: !cacheRef.isOn}" :style="{'border-left':cacheRef.isReverse ? '1px #db2828 solid' : ''}"> <td :class="{'color-border': cacheRef.conds != null && cacheRef.conds.connector == 'and', disabled: !cacheRef.isOn}" :style="{'border-left':cacheRef.isReverse ? '1px #db2828 solid' : ''}">
@@ -59,13 +58,7 @@ Vue.component("http-cache-refs-box", {
<grey-label v-if="cacheRef.allowPartialContent">区间缓存</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.enableIfNoneMatch">If-None-Match</grey-label>
<grey-label v-if="cacheRef.enableIfModifiedSince">If-Modified-Since</grey-label> <grey-label v-if="cacheRef.enableIfModifiedSince">If-Modified-Since</grey-label>
</td> <grey-label v-if="cacheRef.enableReadingOriginAsync">支持异步</grey-label>
<td :class="{disabled: !cacheRef.isOn}">
<span v-if="cacheRef.conds != null">
<span v-if="cacheRef.conds.connector == 'and'">和</span>
<span v-if="cacheRef.conds.connector == 'or'">或</span>
</span>
<span v-else>或</span>
</td> </td>
<td :class="{disabled: !cacheRef.isOn}"> <td :class="{disabled: !cacheRef.isOn}">
<span v-if="!cacheRef.isReverse">{{cacheRef.life.count}} {{timeUnitName(cacheRef.life.unit)}}</span> <span v-if="!cacheRef.isReverse">{{cacheRef.life.count}} {{timeUnitName(cacheRef.life.unit)}}</span>

View File

@@ -167,8 +167,7 @@ Vue.component("http-cache-refs-config-box", {
<tr> <tr>
<th style="width:1em"></th> <th style="width:1em"></th>
<th>缓存条件</th> <th>缓存条件</th>
<th class="two wide">分组关系</th> <th style="width: 7em">缓存时间</th>
<th class="width10">缓存时间</th>
<th class="three op">操作</th> <th class="three op">操作</th>
</tr> </tr>
</thead> </thead>
@@ -192,13 +191,7 @@ Vue.component("http-cache-refs-config-box", {
<grey-label v-if="cacheRef.allowPartialContent">区间缓存</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.enableIfNoneMatch">If-None-Match</grey-label>
<grey-label v-if="cacheRef.enableIfModifiedSince">If-Modified-Since</grey-label> <grey-label v-if="cacheRef.enableIfModifiedSince">If-Modified-Since</grey-label>
</td> <grey-label v-if="cacheRef.enableReadingOriginAsync">支持异步</grey-label>
<td :class="{disabled: !cacheRef.isOn}">
<span v-if="cacheRef.conds != null">
<span v-if="cacheRef.conds.connector == 'and'">和</span>
<span v-if="cacheRef.conds.connector == 'or'">或</span>
</span>
<span v-else>或</span>
</td> </td>
<td :class="{disabled: !cacheRef.isOn}"> <td :class="{disabled: !cacheRef.isOn}">
<span v-if="!cacheRef.isReverse">{{cacheRef.life.count}} {{timeUnitName(cacheRef.life.unit)}}</span> <span v-if="!cacheRef.isReverse">{{cacheRef.life.count}} {{timeUnitName(cacheRef.life.unit)}}</span>