缓存支持请求方法设置

This commit is contained in:
GoEdgeLab
2021-12-07 10:43:42 +08:00
parent 46d979e695
commit 928bbae0c8
2 changed files with 7 additions and 0 deletions

View File

@@ -81,6 +81,12 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
}
}
// 校验请求
if !this.cacheRef.MatchRequest(this.RawReq) {
this.cacheRef = nil
return
}
// 相关变量
this.varMapping["cache.policy.name"] = cachePolicy.Name
this.varMapping["cache.policy.id"] = strconv.FormatInt(cachePolicy.Id, 10)