pub enum CacheDirective {
Public,
Private,
NoStore,
NoCache,
NoTransform,
MustRevalidate,
ProxyRevalidate,
StaleIfError,
StaleWhileRevalidate,
SMaxAge,
OnlyIfCached,
Immutable,
}Expand description
Individual Cache-Control directives.
These directives control how responses are cached by browsers, proxies, and CDNs. See RFC 7234 for full specification.
Variants§
Public
Response may be stored by any cache.
Private
Response may only be stored by browser cache (not shared caches like CDNs).
NoStore
Response must not be stored by any cache.
NoCache
Cache must validate with server before using cached response.
NoTransform
Cache must not transform the response (e.g., compress images).
MustRevalidate
Cached response must be revalidated once it becomes stale.
ProxyRevalidate
Like must-revalidate but only for shared caches.
StaleIfError
Response may be served stale if origin is unreachable.
StaleWhileRevalidate
Response may be served stale while revalidating in background.
SMaxAge
Only cache if explicitly told to (for shared caches).
OnlyIfCached
Do not store response in persistent storage.
Immutable
Indicates an immutable response that won’t change during its freshness lifetime.
Trait Implementations§
Source§impl Clone for CacheDirective
impl Clone for CacheDirective
Source§fn clone(&self) -> CacheDirective
fn clone(&self) -> CacheDirective
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more