pub fn append_headers(uri: &str, resp: &mut Response<Body>) {
    // Default max-age value in seconds (one day)
    let mut max_age = MAX_AGE_ONE_DAY;

    if CACHE_EXT_ONE_HOUR
        .iter()
        .any(|x| uri.ends_with(&[".", *x].concat()))
    {
        max_age = MAX_AGE_ONE_HOUR;
    } else if CACHE_EXT_ONE_YEAR
        .iter()
        .any(|x| uri.ends_with(&[".", *x].concat()))
    {
        max_age = MAX_AGE_ONE_YEAR;
    }

    let cache_control = CacheControl::new()
        .with_public()
        .with_max_age(duration_from_secs(max_age));
    resp.headers_mut().typed_insert(cache_control);
}
/// It appends a `Cache-Control` header to a response if that one is part of a set of file types.
It appends a `Cache-Control` header to a response if that one is part of a set of file types.
It appends a ` Cache - Control ` header to a response if that one is part of a set of file types .
pub fn append_headers(uri: &str, resp: &mut Response<Body>) {
    // Default max-age value in seconds (one day)
    let mut max_age = MAX_AGE_ONE_DAY;
    if CACHE_EXT_ONE_HOUR
        .iter()
        .any(|x| uri.ends_with(&[".", *x].concat()))
    {
        max_age = MAX_AGE_ONE_HOUR;
    } else if CACHE_EXT_ONE_YEAR
        .iter()
        .any(|x| uri.ends_with(&[".", *x].concat()))
    {
        max_age = MAX_AGE_ONE_YEAR;
    }
    let cache_control = CacheControl::new()
        .with_public()
        .with_max_age(duration_from_secs(max_age));
    resp.headers_mut().typed_insert(cache_control);
}
pub fn append_headers ( uri : & str , resp : & mut Response < Body > ) { // Default max-age value in seconds (one day) let mut max_age = MAX_AGE_ONE_DAY ; if CACHE_EXT_ONE_HOUR . iter ( ) . any ( | x | uri . ends_with ( & [ " " , * x ] . concat ( ) ) ) { max_age = MAX_AGE_ONE_HOUR ; } else if CACHE_EXT_ONE_YEAR . iter ( ) . any ( | x | uri . ends_with ( & [ " " , * x ] . concat ( ) ) ) { max_age = MAX_AGE_ONE_YEAR ; } let cache_control = CacheControl :: new ( ) . with_public ( ) . with_max_age ( duration_from_secs ( max_age ) ) ; resp . headers_mut ( ) . typed_insert ( cache_control ) ; }
It appends a `Cache-Control` header to a response if that one is part of a set of file types.
It appends a ` Cache - Control ` header to a response if that one is part of a set of file types .
uri
&str
resp
&mut Response<Body>
uri
&str
resp
&mut Response<Body>