server: cache fixes

This commit is contained in:
nym21
2026-04-05 22:43:30 +02:00
parent 2b15a24b6d
commit acd3d6f425
15 changed files with 156 additions and 48 deletions
+7
View File
@@ -33,6 +33,13 @@ pub struct CacheParams {
}
impl CacheParams {
pub fn immutable(version: Version) -> Self {
Self {
etag: Some(format!("i{version}")),
cache_control: "public, max-age=1, must-revalidate".into(),
}
}
/// Cache params using CARGO_PKG_VERSION as etag (for openapi.json etc.)
pub fn static_version() -> Self {
Self {