Set Cache-Control to 60s on failed fetch

This way we can permit a fast retry while keeping some control on DoS attacks
This commit is contained in:
Daniele Tonon
2023-08-04 15:40:30 +02:00
parent ecd5d0c173
commit 2fcf17aa1d
3 changed files with 9 additions and 0 deletions

View File

@@ -74,6 +74,8 @@ func renderRelayPage(w http.ResponseWriter, r *http.Request) {
if len(renderableLastNotes) != 0 {
w.Header().Set("Cache-Control", "max-age=604800")
} else {
w.Header().Set("Cache-Control", "max-age=60")
}
if err := tmpl.ExecuteTemplate(w, templateMapping[typ], params); err != nil {