You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let etag = ETag::from_str(&*format!(r#""{}""#,*VERSION_UUID)).unwrap();
589
+
letmut response = http::Response::builder()
590
+
.header_typed(etag.clone())
591
+
.header(CACHE_CONTROL,"max-age=60, stale-while-revalidate=86400");// tell client to use cached response for one day, but revalidate in background if older than one minute
592
+
593
+
let if_none_match = req.headers().typed_get::<IfNoneMatch>();
594
+
ifletSome(if_none_match) = if_none_match {
595
+
if !if_none_match.precondition_passes(&etag){
596
+
returnSome(not_modified(response));// tell client that the resource was not modified and to use cached response
0 commit comments