mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-15 00:30:24 +08:00
缓存支持请求方法设置
This commit is contained in:
@@ -110,6 +110,7 @@ func (this *HTTPRequest) init() {
|
||||
// 缓存相关初始化
|
||||
"cache.status": "BYPASS",
|
||||
"cache.age": "0",
|
||||
"cache.key": "",
|
||||
"cache.policy.name": "",
|
||||
"cache.policy.id": "0",
|
||||
"cache.policy.type": "",
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user