Cache robots.txt

This commit is contained in:
spikecodes 2021-01-06 14:19:10 -08:00
parent 0f506fc41b
commit b33d79ed9b
2 changed files with 10 additions and 13 deletions

View file

@ -16,7 +16,9 @@ async fn style() -> HttpResponse {
}
async fn robots() -> HttpResponse {
HttpResponse::Ok().body(include_str!("../static/robots.txt"))
HttpResponse::Ok()
.header("Cache-Control", "public, max-age=1209600, s-maxage=86400")
.body(include_str!("../static/robots.txt"))
}
#[get("/favicon.ico")]