Skip to main content

cache_window

Function cache_window 

Source
pub fn cache_window(
    status: u16,
    ttl: Duration,
    swr: Duration,
    negative_ttl: Duration,
) -> Option<(Duration, Duration)>
Expand description

Caching policy by status class (§“Mode 2 caching beyond TTL”): 2xx/3xx cache under ttl+swr; non-2xx (4xx) cache under negative_ttl with no SWR window; 5xx is never cached. Returns (ttl, swr) to store under, or None to skip caching.