如果缓存条件支持206 Partial Content,则第一次加载时自动尝试从分片缓存中读取内容

This commit is contained in:
刘祥超
2022-06-18 19:31:10 +08:00
parent 4c4033bb56
commit b1d0c8852e
2 changed files with 8 additions and 2 deletions

View File

@@ -312,9 +312,10 @@ func (this *HTTPWriter) PrepareCache(resp *http.Response, size int64) {
if !caches.CanIgnoreErr(err) {
remotelogs.Error("HTTP_WRITER", "write cache failed: "+err.Error())
this.Header().Set("X-Cache", "BYPASS, write cache failed")
} else {
this.Header().Set("X-Cache", "BYPASS, "+err.Error())
}
this.Header().Set("X-Cache", "BYPASS, too many requests")
return
}
this.cacheWriter = cacheWriter