1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2025-01-11 02:35:49 +00:00

Enable caching for assets

This commit is contained in:
Felix Ableitner 2024-12-11 15:45:37 +01:00
parent 3e7c922daf
commit e6cdb860cf

View file

@ -40,6 +40,10 @@ pub async fn file_and_error_handler(
.unwrap_or_else(|| APPLICATION_OCTET_STREAM.essence_str()),
)?,
);
headers.insert(
HeaderName::from_static("cache-control"),
HeaderValue::from_static("max-age=3600, public"),
);
Ok((headers, content.contents()).into_response())
}
}