Struct buildsrs_storage::CacheConfig
source · pub struct CacheConfig {
pub capacity: u64,
pub timeout_missing: Duration,
}
Expand description
Configuration for storage Cache
.
This allows you to override the behaviour of the cache. In general, you should use the
CacheConfig::default()
implementation to create a default configuration. The value
that you should consider tweaking is the capacity
, which you should set to however much
memory you are willing to throw at the cache.
Fields§
§capacity: u64
Capacity of cache, in bytes.
You should set this to however much memory you are willing to use for the cache. In general, the higher you set this to, the better. The default is set to 16MB.
timeout_missing: Duration
Timeout for missing crate entries.
Packages are immutable once published, so we can cache them forever. However, we are also caching negative lookup results, but these can change as artifacts are published. For that reason, negative lookups have a dedicated cache duration that should be set to a low value.
Trait Implementations§
source§impl Clone for CacheConfig
impl Clone for CacheConfig
source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more