[−][src]Struct http_cache_semantics::CachePolicyOptions
Holds configuration options which control the behavior of the cache and are independent of any specific request or response.
Fields
If shared
is true
(default), then the response is evaluated from a
perspective of a shared cache (i.e. private
is not cacheable and
s-maxage
is respected). If shared
is false
, then the response is
evaluated from a perspective of a single-user cache (i.e. private
is
cacheable and s-maxage
is ignored). shared: true
is recommended
for HTTP clients.
cache_heuristic: f32
cache_heuristic
is a fraction of response's age that is used as a
fallback cache duration. The default is 0.1 (10%), e.g. if a file
hasn't been modified for 100 days, it'll be cached for 100*0.1 = 10
days.
immutable_min_time_to_live: Duration
immutable_min_time_to_live
is a duration to assume as the
default time to cache responses with Cache-Control: immutable
. Note
that per RFC these can become stale, so max-age
still overrides the
default.
ignore_cargo_cult: bool
If ignore_cargo_cult
is true
, common anti-cache directives will be
completely ignored if the non-standard pre-check
and post-check
directives are present. These two useless directives are most commonly
found in bad StackOverflow answers and PHP's "session limiter"
defaults.
trust_server_date: bool
If trust_server_date
is false
, then server's Date
header won't
be used as the base for max-age
. This is against the RFC, but it's
useful if you want to cache responses with very short max-age
, but
your local clock is not exactly in sync with the server's.
response_time: SystemTime
When the response has been received. SystemTime::now
.
Trait Implementations
impl Clone for CachePolicyOptions
[src]
fn clone(&self) -> CachePolicyOptions
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CachePolicyOptions
[src]
impl Debug for CachePolicyOptions
[src]
impl Default for CachePolicyOptions
[src]
impl<'de> Deserialize<'de> for CachePolicyOptions
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for CachePolicyOptions
[src]
Auto Trait Implementations
impl RefUnwindSafe for CachePolicyOptions
impl Send for CachePolicyOptions
impl Sync for CachePolicyOptions
impl Unpin for CachePolicyOptions
impl UnwindSafe for CachePolicyOptions
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,