mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user