httpd: Mark immutable response as such with Cache-Control header
For responses to requests for content that is content-addressed with Git object IDs and consequently immutable, we add a Cache-Control HTTP header that marks the responses as public, immutable and instructs clients to cache the response for up to 7 days.
2 files changed
+29
-10
1c4a2cd1
→
e52ce483
modified radicle-httpd/src/api/v1/projects.rs
@@ -28,7 +28,7 @@ use radicle_surf::{diff, Glob, Oid, Repository};
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -181,7 +181,7 @@ pub struct CommitsQueryString {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -195,6 +195,11 @@ async fn history_handler(
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -258,7 +263,11 @@ async fn history_handler(
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -318,13 +327,13 @@ async fn commit_handler(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -391,7 +400,7 @@ async fn diff_handler(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -439,7 +448,7 @@ async fn tree_handler(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -454,7 +463,7 @@ async fn tree_handler(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -566,7 +575,7 @@ async fn readme_handler(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle-httpd/src/axum_extra.rs
@@ -2,7 +2,8 @@ use axum::extract::path::ErrorKind;
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -87,3 +88,12 @@ pub struct Error {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |