cache接口约束增加定义缓存剩余时间 + 请求预热配置

This commit is contained in:
2024-10-09 18:44:24 +08:00
parent c50cb0039a
commit 4092863a9a
2 changed files with 31 additions and 0 deletions

19
define/cache.go Normal file
View File

@ -0,0 +1,19 @@
// Package define ...
//
// Description : define ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2024-10-09 18:39
package define
// CachePreHeatConfig 缓存预热配置, MinPercent / MinTTL 同时配置, 则任意一个满足, 均进行预热
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 18:40 2024/10/9
type CachePreHeatConfig struct {
Enable bool `json:"enable"` // 缓存预热是否可用
MinPercent int `json:"min_percent"` // 最小百分比, 剩余有效期低于此百分比进行预热
MinTTL int64 `json:"min_ttl"` // 最小剩余生命周期, 低于此百分比进行预热
}