缓存条件增加“强制Range回源选项”

This commit is contained in:
GoEdgeLab
2023-07-31 17:31:42 +08:00
parent 0bc8e75e1f
commit fd060c65d0
3 changed files with 18 additions and 9 deletions

View File

@@ -150,7 +150,7 @@ Vue.component("http-cache-ref-box", {
}
switch (condCategory) {
case "simple":
dialog.style.width = "40em"
dialog.style.width = "45em"
break
case "complex":
let width = window.parent.innerWidth
@@ -267,13 +267,6 @@ Vue.component("http-cache-ref-box", {
<p class="comment">内容尺寸如果低于此值则不缓存。</p>
</td>
</tr>
<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>
<tr v-show="moreOptionsVisible && !vIsReverse">
<td>支持缓存分片内容</td>
<td>
@@ -281,13 +274,20 @@ Vue.component("http-cache-ref-box", {
<p class="comment">选中后,支持缓存源站返回的某个分片的内容,该内容通过<code-label>206 Partial Content</code-label>状态码返回。</p>
</td>
</tr>
<tr v-show="moreOptionsVisible && !vIsReverse && ref.allowPartialContent">
<tr v-show="moreOptionsVisible && !vIsReverse && ref.allowPartialContent && !ref.alwaysForwardRangeReques">
<td>强制返回分片内容</td>
<td>
<checkbox name="forcePartialContent" value="1" v-model="ref.forcePartialContent"></checkbox>
<p class="comment">选中后,表示无论客户端是否发送<code-label>Range</code-label>报头,都会优先尝试返回已缓存的分片内容;如果你的应用有不支持分片内容的客户端(比如有些下载软件不支持<code-label>206 Partial Content</code-label>),请务必关闭此功能。</p>
</td>
</tr>
<tr v-show="moreOptionsVisible && !vIsReverse">
<td>强制Range回源</td>
<td>
<checkbox v-model="ref.alwaysForwardRangeRequest"></checkbox>
<p class="comment">选中后表示把所有包含Range报头的请求都转发到源站而不是尝试从缓存中读取。</p>
</td>
</tr>
<tr v-show="moreOptionsVisible && !vIsReverse">
<td>状态码列表</td>
<td>
@@ -343,6 +343,13 @@ Vue.component("http-cache-ref-box", {
<p class="comment">试验功能。允许客户端中断连接后,仍然继续尝试从源站读取内容并缓存。</p>
</td>
</tr>
<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>
<tr v-show="false">
<td colspan="2"><input type="hidden" name="cacheRefJSON" :value="JSON.stringify(ref)"/></td>
</tr>