mirror of
https://github.com/Nutomic/ibis.git
synced 2025-01-11 04:55:49 +00:00
Enable caching for assets
This commit is contained in:
parent
3e7c922daf
commit
e6cdb860cf
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,10 @@ pub async fn file_and_error_handler(
|
||||||
.unwrap_or_else(|| APPLICATION_OCTET_STREAM.essence_str()),
|
.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())
|
Ok((headers, content.contents()).into_response())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue