缓存可以设置是否使用系统默认设置

This commit is contained in:
刘祥超
2022-02-24 20:39:17 +08:00
parent 6be39294d0
commit 274c4fe122

View File

@@ -12,13 +12,14 @@ type HTTPCacheConfig struct {
AddStatusHeader bool `yaml:"addStatusHeader" json:"addStatusHeader"` // 是否增加命中状态HeaderX-Cache
AddAgeHeader bool `yaml:"addAgeHeader" json:"addAgeHeader"` // 是否增加Age Header
EnableCacheControlMaxAge bool `yaml:"enableCacheControlMaxAge" json:"enableCacheControlMaxAge"` // 是否支持Cache-Control: max-age=...
DisablePolicyRefs bool `yaml:"disablePolicyRefs" json:"disablePolicyRefs"` // 停用策略中定义的条件
PurgeIsOn bool `yaml:"purgeIsOn" json:"purgeIsOn"` // 是否允许使用Purge方法清理
PurgeKey string `yaml:"purgeKey" json:"purgeKey"` // Purge时使用的X-Edge-Purge-Key
Stale *HTTPCacheStaleConfig `yaml:"stale" json:"stale"` // 陈旧缓存使用策略
CacheRefs []*HTTPCacheRef `yaml:"cacheRefs" json:"cacheRefs"` // 缓存配置
CacheRefs []*HTTPCacheRef `yaml:"cacheRefs" json:"cacheRefs"` // 缓存条件配置
}
func (this *HTTPCacheConfig) Init() error {