pub struct CacheControlService<S> { /* private fields */ }Expand description
§Cache-Control setter Service.
Assigns a value based on a response status:
- on
1xxand2xxtakes ano-cacherequest 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
3xxtakes the default and prevents CDN from caching the response; - on
4xxcaching is disabled; - on
5xx30 min TTL is set.
TTL defaults to 5 seconds.
Trait Implementations§
Source§impl<S: Clone> Clone for CacheControlService<S>
impl<S: Clone> 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 (const: unstable) · 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> Debug for CacheControlService<S>
impl<S: Debug> Debug for CacheControlService<S>
Source§impl<B, D, S> Service<Request<B>> for CacheControlService<S>
impl<B, D, S> Service<Request<B>> for CacheControlService<S>
Source§type Future = Pin<Box<dyn Future<Output = Result<<CacheControlService<S> as Service<Request<B>>>::Response, <CacheControlService<S> as Service<Request<B>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<CacheControlService<S> as Service<Request<B>>>::Response, <CacheControlService<S> as Service<Request<B>>>::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>where
S: Send,
impl<S> Sync for CacheControlService<S>where
S: Sync,
impl<S> Unpin for CacheControlService<S>where
S: Unpin,
impl<S> UnsafeUnpin for CacheControlService<S>where
S: UnsafeUnpin,
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