缓存关闭X-Cache显示时从Header中删除X-Cache

This commit is contained in:
GoEdgeLab
2022-02-21 16:55:25 +08:00
parent d40a775b6a
commit 35e8b1a9ba

View File

@@ -252,6 +252,8 @@ func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) {
} else { } else {
this.writer.Header().Set("X-Cache", "HIT, "+refType+", "+reader.TypeName()) this.writer.Header().Set("X-Cache", "HIT, "+refType+", "+reader.TypeName())
} }
} else {
this.writer.Header().Del("X-Cache")
} }
if this.web.Cache.AddAgeHeader { if this.web.Cache.AddAgeHeader {
this.writer.Header().Set("Age", age) this.writer.Header().Set("Age", age)