feat: on memory cache if less than 4k or specified cache size.

This commit is contained in:
Jun Kurihara 2023-08-18 18:59:28 +09:00
commit 5f6758ff9e
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
5 changed files with 82 additions and 29 deletions

View file

@ -38,6 +38,7 @@ pub struct CacheOption {
pub cache_dir: Option<String>,
pub max_cache_entry: Option<usize>,
pub max_cache_each_size: Option<usize>,
pub max_cache_each_size_on_memory: Option<usize>,
}
#[derive(Deserialize, Debug, Default, PartialEq, Eq, Clone)]
@ -184,6 +185,9 @@ impl TryInto<ProxyConfig> for &ConfigToml {
if let Some(num) = cache_option.max_cache_each_size {
proxy_config.cache_max_each_size = num;
}
if let Some(num) = cache_option.max_cache_each_size_on_memory {
proxy_config.cache_max_each_size_on_memory = num;
}
}
}