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

This commit is contained in:
刘祥超
2023-07-31 17:32:09 +08:00
parent fa04c041df
commit 18b76013b9

View File

@@ -90,6 +90,13 @@ func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) {
return
}
// 是否强制Range回源
if this.cacheRef.AlwaysForwardRangeRequest && len(this.RawReq.Header.Get("Range")) > 0 {
this.cacheRef = nil
cacheBypassDescription = "BYPASS, forward range"
return
}
// 是否正在Purge
var isPurging = this.web.Cache.PurgeIsOn && strings.ToUpper(this.RawReq.Method) == "PURGE" && this.RawReq.Header.Get("X-Edge-Purge-Key") == this.web.Cache.PurgeKey
if isPurging {