diff --git a/docs/llms.txt b/docs/llms.txt index 2089cc5..a4da944 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -58,8 +58,7 @@ http3: {} # HTTP/3 配置 resolver: {} # DNS 解析配置 performance: {} # 性能配置 shutdown: {} # 关闭配置 -include: [] # 配置引入 -cache_path: {} # 缓存路径配置 + include: [] # 配置引入 ``` ### 运行模式 diff --git a/internal/config/cache_config.go b/internal/config/cache_config.go index a5d5f5f..3b7e1e7 100644 --- a/internal/config/cache_config.go +++ b/internal/config/cache_config.go @@ -2,54 +2,6 @@ package config import "time" -// ProxyCachePathConfig 缓存路径配置(磁盘持久化)。 -// -// 配置磁盘缓存路径和相关参数,支持 L1/L2 分层缓存架构。 -// 配置后,代理缓存将持久化到磁盘,服务重启后可恢复。 -// -// 注意事项: -// - Path 为必填项,指定缓存根目录 -// - Levels 支持最多 3 级目录(如 "1:2:2") -// - MaxSize 为 0 表示不限制大小 -// - L1MaxEntries/L1MaxSize 为 0 时使用默认值 -// -// 使用示例: -// -// cache_path: -// path: "/var/cache/lolly" -// levels: "1:2" -// max_size: "1GB" -// inactive: "60m" -// l1_max_entries: 10000 -type ProxyCachePathConfig struct { - // Path 缓存根目录 - Path string `yaml:"path"` - - // Levels 目录层级,如 "1:2" 表示两级目录 - Levels string `yaml:"levels"` - - // MaxSize 最大缓存大小(字节) - MaxSize int64 `yaml:"max_size"` - - // Inactive 未访问淘汰时间 - Inactive time.Duration `yaml:"inactive"` - - // Purger 是否启用后台清理 - Purger bool `yaml:"purger"` - - // PurgerInterval 清理间隔 - PurgerInterval time.Duration `yaml:"purger_interval"` - - // L1MaxEntries L1 最大条目数 - L1MaxEntries int64 `yaml:"l1_max_entries"` - - // L1MaxSize L1 最大内存大小 - L1MaxSize int64 `yaml:"l1_max_size"` - - // PromoteThreshold 提升到 L1 的访问阈值 - PromoteThreshold int `yaml:"promote_threshold"` -} - // ProxyCacheConfig 代理缓存配置。 // // 缓存后端响应,减少重复请求,提高响应速度。 diff --git a/internal/config/config.go b/internal/config/config.go index 10a6e14..ff5d0a1 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -81,8 +81,7 @@ type Config struct { Resolver ResolverConfig `yaml:"resolver"` Performance PerformanceConfig `yaml:"performance"` Shutdown ShutdownConfig `yaml:"shutdown"` - Include []IncludeConfig `yaml:"include"` // 配置引入,支持从其他文件引入配置片段 - CachePath *ProxyCachePathConfig `yaml:"cache_path"` // 缓存路径配置(磁盘持久化) + Include []IncludeConfig `yaml:"include"` // 配置引入,支持从其他文件引入配置片段 } // parseSize 解析大小字符串(支持 k, m 单位)。 diff --git a/internal/e2e/testutil/config.go b/internal/e2e/testutil/config.go index ea1319a..704447f 100644 --- a/internal/e2e/testutil/config.go +++ b/internal/e2e/testutil/config.go @@ -462,15 +462,6 @@ func (b *ConfigBuilder) WithRewrite(pattern, replacement string, opts ...Rewrite return b } -// WithCachePath 配置缓存路径。 -func (b *ConfigBuilder) WithCachePath(path string, maxSize int64) *ConfigBuilder { - b.cfg.CachePath = &config.ProxyCachePathConfig{ - Path: path, - MaxSize: maxSize, - } - return b -} - // WithResolver 配置 DNS 解析器。 func (b *ConfigBuilder) WithResolver(addresses []string, valid, timeout time.Duration) *ConfigBuilder { b.cfg.Resolver = config.ResolverConfig{