pub enum CacheControl {
Long,
Medium,
Short,
NoCache,
Custom(&'static str),
}
Expand description
Options to choose from to configure the Cache-Control header for served files. See Cache control
Variants§
Long
clients can keep assets that have cache busting for a year: "max-age=31536000, immutable"
Medium
assets without cache busting are revalidated after a day and can be kept for a week: "max-age=604800, stale-while-revalidate=86400"
Short
cache kept for max 5 minutes, only at the client (not in a proxy): "max-age:300, private"
NoCache
do not cache if freshness is really vital: "no-cache"
Custom(&'static str)
custom value
Trait Implementations§
Source§impl Clone for CacheControl
impl Clone for CacheControl
Source§fn clone(&self) -> CacheControl
fn clone(&self) -> CacheControl
Returns a copy 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 CacheControl
impl Debug for CacheControl
impl Copy for CacheControl
Auto Trait Implementations§
impl Freeze for CacheControl
impl RefUnwindSafe for CacheControl
impl Send for CacheControl
impl Sync for CacheControl
impl Unpin for CacheControl
impl UnwindSafe for CacheControl
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