Update http_request_cache.go

This commit is contained in:
GoEdgeLab
2022-02-24 20:39:43 +08:00
parent 50232d4938
commit 36d8c3f366

View File

@@ -63,7 +63,7 @@ func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) {
break
}
}
if this.cacheRef == nil {
if this.cacheRef == nil && !this.web.Cache.DisablePolicyRefs {
// 检查策略默认的缓存条件
for _, cacheRef := range cachePolicy.CacheRefs {
if !cacheRef.IsOn ||
@@ -80,11 +80,11 @@ func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) {
break
}
}
}
if this.cacheRef == nil {
return
}
}
// 校验请求
if !this.cacheRef.MatchRequest(this.RawReq) {