增加简化的缓存条件设置

This commit is contained in:
GoEdgeLab
2022-09-03 18:15:56 +08:00
parent ae68007530
commit 5edf0e5b9e

View File

@@ -29,7 +29,8 @@ type HTTPCacheRef struct {
EnableIfNoneMatch bool `yaml:"enableIfNoneMatch" json:"enableIfNoneMatch"`
EnableIfModifiedSince bool `yaml:"enableIfModifiedSince" json:"enableIfModifiedSince"`
Conds *shared.HTTPRequestCondsConfig `yaml:"conds" json:"conds"` // 请求条件
Conds *shared.HTTPRequestCondsConfig `yaml:"conds" json:"conds"` // 复杂请求条件组合
SimpleCond *shared.HTTPRequestCond `yaml:"simpleCond" json:"simpleCond"` // 简单条件
CachePolicy *HTTPCachePolicy `yaml:"cachePolicy" json:"cachePolicy"`
@@ -69,6 +70,13 @@ func (this *HTTPCacheRef) Init() error {
}
}
if this.SimpleCond != nil {
err := this.SimpleCond.Init()
if err != nil {
return err
}
}
// policy
if this.CachePolicy != nil {
err := this.CachePolicy.Init()