From f7c4b7c7936a56a99170215a2a5bf35f317ee619 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 31 Jul 2023 17:32:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9D=A1=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E2=80=9C=E5=BC=BA=E5=88=B6Range=E5=9B=9E=E6=BA=90?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_cache.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/nodes/http_request_cache.go b/internal/nodes/http_request_cache.go index efd81d3..e316a59 100644 --- a/internal/nodes/http_request_cache.go +++ b/internal/nodes/http_request_cache.go @@ -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 {