pub struct CacheConfig {
pub enabled: bool,
pub url: String,
pub prefix: String,
pub default_ttl_secs: u64,
pub timeout_secs: u64,
}Expand description
An optional Redis cache.
Nothing in the framework caches through it: resources, permissions and the
admin manifest all behave exactly the same whether it is configured or not.
It exists so a function has somewhere to put a rate-limit counter, a
memoised third-party response or a short-lived token — see the cache_*
helpers on a function’s Context.
Off unless url is set, so an app that doesn’t want one pays nothing.
Fields§
§enabled: boolTurn the configured cache off without deleting its settings.
url: StringConnection URL, e.g. redis://127.0.0.1:6379 or rediss://…/0. Empty
(the default) means no cache.
prefix: StringPrepended to every key a function uses, so several apps can share one Redis without colliding.
default_ttl_secs: u64Expiry applied to a set that doesn’t ask for one. 0 = keys persist.
timeout_secs: u64How long one cache operation may take before it is abandoned.
Implementations§
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more