Skip to main content

Module cache

Module cache 

Source
Expand description

HTTP caching helpers covering validators, freshness, and revalidation.

Implements parsing of Cache-Control, derivation of freshness metadata, and helpers for ensuring compliant response headers per RFC 9111.

Structs§

CacheControl
Represents parsed Cache-Control directives.
CachePolicy
Represents cache policy metadata derived from headers.

Functions§

ensure_age_header
Ensure the Age header is set when absent (origin servers should emit Age).
freshness_lifetime
Compute the freshness lifetime hinted by the headers.
parse_cache_control
Parse a Cache-Control header into structured directives.
policy_from_headers
Analyse response headers to produce a CachePolicy.