Skip to content

Commit 8edebcc

Browse files
committed
... and set immutable
1 parent 7dfae74 commit 8edebcc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- Use the [two-face](https://docs.rs/two-face) crate for an extended syntax
2626
list.
2727
- Serve all CSS assets under hashed URL to avoid caching issues and set
28-
cache-control header to one month.
28+
cache-control header to one month and the `immutable` attribute.
2929
- Do not offer any interactions for burn-after-reading pastes that will end up
3030
with a 404 anyway.
3131

src/assets.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ impl IntoResponse for Asset {
3434
let headers = (
3535
TypedHeader(content_type_header),
3636
TypedHeader(
37-
headers::CacheControl::new().with_max_age(Duration::from_secs(60 * 60 * 24 * 30)),
37+
headers::CacheControl::new()
38+
.with_max_age(Duration::from_secs(60 * 60 * 24 * 30))
39+
.with_immutable(),
3840
),
3941
);
4042

0 commit comments

Comments
 (0)