优化代码

This commit is contained in:
GoEdgeLab
2024-04-20 15:51:48 +08:00
parent 1667fd175f
commit b4c8f9cd02

View File

@@ -256,11 +256,9 @@ func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) {
if this.web.Compression != nil && this.web.Compression.IsOn { if this.web.Compression != nil && this.web.Compression.IsOn {
_, encoding, ok := this.web.Compression.MatchAcceptEncoding(this.RawReq.Header.Get("Accept-Encoding")) _, encoding, ok := this.web.Compression.MatchAcceptEncoding(this.RawReq.Header.Get("Accept-Encoding"))
if ok { if ok {
if reader == nil { reader, _ = storage.OpenReader(key+caches.SuffixCompression+encoding, useStale, false)
reader, _ = storage.OpenReader(key+caches.SuffixCompression+encoding, useStale, false) if reader != nil {
if reader != nil { tags = append(tags, encoding)
tags = append(tags, encoding)
}
} }
} }
} }