Trait CacheStrategy
Source pub trait CacheStrategy<B> {
// Required method
fn computed_key(&self, req: &Request<B>) -> (Duration, Key);
// Provided method
fn ttl(&self) -> Duration { ... }
}
Expand description
Trait used for extensible definition of caching strategies for the middleware
Compute the key for caching.
This function will receive the Request sent into the handler so that it may use
attributes of the incoming request for caching
The default time to live for all cached entries
This can be overridden by different strategies but defaults to 1 day