pub enum CachePreset {
NoCache,
PrivateNoCache,
PublicOneHour,
Immutable,
CdnFriendly,
StaticAssets,
}Expand description
Common cache control presets for typical use cases.
Variants§
NoCache
No caching: no-store, no-cache, must-revalidate
PrivateNoCache
Private caching only: private, max-age=0, must-revalidate
PublicOneHour
Standard public caching: public, max-age=3600
Immutable
Long-term immutable: public, max-age=31536000, immutable
CdnFriendly
CDN-friendly with short browser TTL: public, max-age=60, s-maxage=3600
StaticAssets
Static assets: public, max-age=86400
Implementations§
Source§impl CachePreset
impl CachePreset
Sourcepub fn to_header_value(&self) -> String
pub fn to_header_value(&self) -> String
Convert preset to Cache-Control header value.
Sourcepub fn to_builder(&self) -> CacheControlBuilder
pub fn to_builder(&self) -> CacheControlBuilder
Convert preset to a CacheControlBuilder for further customization.
Trait Implementations§
Source§impl Clone for CachePreset
impl Clone for CachePreset
Source§fn clone(&self) -> CachePreset
fn clone(&self) -> CachePreset
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CachePreset
impl Debug for CachePreset
Source§impl PartialEq for CachePreset
impl PartialEq for CachePreset
impl Copy for CachePreset
impl Eq for CachePreset
impl StructuralPartialEq for CachePreset
Auto Trait Implementations§
impl Freeze for CachePreset
impl RefUnwindSafe for CachePreset
impl Send for CachePreset
impl Sync for CachePreset
impl Unpin for CachePreset
impl UnwindSafe for CachePreset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).