From b67c2ec39c45083417af6b563c2ee1827accc9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 21 Feb 2022 16:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=85=B3=E9=97=ADX-Cache?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=97=B6=E4=BB=8EHeader=E4=B8=AD=E5=88=A0?= =?UTF-8?q?=E9=99=A4X-Cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_cache.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/nodes/http_request_cache.go b/internal/nodes/http_request_cache.go index 266f2e0..cf8f0d2 100644 --- a/internal/nodes/http_request_cache.go +++ b/internal/nodes/http_request_cache.go @@ -252,6 +252,8 @@ func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) { } else { this.writer.Header().Set("X-Cache", "HIT, "+refType+", "+reader.TypeName()) } + } else { + this.writer.Header().Del("X-Cache") } if this.web.Cache.AddAgeHeader { this.writer.Header().Set("Age", age)