mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-25 11:36:35 +08:00
增加简化的缓存条件设置
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user