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