触发浏览器304缓存也算缓存命中

This commit is contained in:
GoEdgeLab
2021-06-16 11:04:19 +08:00
parent 7969ad7a76
commit be7fc25f55

View File

@@ -184,6 +184,7 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
// 自定义Header
this.processResponseHeaders(http.StatusNotModified)
this.writer.WriteHeader(http.StatusNotModified)
this.isCached = true
this.cacheRef = nil
return true
}
@@ -193,6 +194,7 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
// 自定义Header
this.processResponseHeaders(http.StatusNotModified)
this.writer.WriteHeader(http.StatusNotModified)
this.isCached = true
this.cacheRef = nil
return true
}