pub struct CacheControlService<S>{ /* private fields */ }
Expand description
§Cache-Control
setter Service.
Assigns a value based on a response status:
- on
1xx
and2xx
takes ano-cache
request header directive or falls back to a default one; - on
301
, likely a permanent move, sets a day TTL and asks CDN to cache the response, too; - on any other
3xx
takes the default and prevents CDN from caching the response; - on
4xx
caching is disabled; - on
5xx
30 min TTL is set.
TTL defaults to 5
seconds.
Trait Implementations§
Source§impl<S> Clone for CacheControlService<S>
impl<S> Clone for CacheControlService<S>
Source§fn clone(&self) -> CacheControlService<S>
fn clone(&self) -> CacheControlService<S>
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<S> Debug for CacheControlService<S>
impl<S> Debug for CacheControlService<S>
Source§impl<ReqB, ResB, S> Service<Request<ReqB>> for CacheControlService<S>
impl<ReqB, ResB, S> Service<Request<ReqB>> for CacheControlService<S>
Source§type Future = Pin<Box<dyn Future<Output = Result<<CacheControlService<S> as Service<Request<ReqB>>>::Response, <CacheControlService<S> as Service<Request<ReqB>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<CacheControlService<S> as Service<Request<ReqB>>>::Response, <CacheControlService<S> as Service<Request<ReqB>>>::Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl<S> Freeze for CacheControlService<S>where
S: Freeze,
impl<S> RefUnwindSafe for CacheControlService<S>where
S: RefUnwindSafe,
impl<S> Send for CacheControlService<S>
impl<S> Sync for CacheControlService<S>
impl<S> Unpin for CacheControlService<S>where
S: Unpin,
impl<S> UnwindSafe for CacheControlService<S>where
S: UnwindSafe,
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