Skip to content

Commit

Permalink
Update cache-control header
Browse files Browse the repository at this point in the history
  • Loading branch information
cofob committed May 14, 2024
1 parent cf8a2ec commit 76bcc99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/routes/redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ async fn cached_redirect(

Ok(actix_web::HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.append_header(("cache-control", format!("public, max-age {}, only-if-cached, stale-while-revalidate 86400, stale-if-error 86400, immutable", config.crawler.ping_interval.as_secs())))
.append_header((
"cache-control",
format!(
"public, max-age={}, stale-while-revalidate=86400, stale-if-error=86400, immutable",
config.crawler.ping_interval.as_secs()
),
))
.body(template.render().expect("failed to render error page")))
}

Expand Down

0 comments on commit 76bcc99

Please sign in to comment.