mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 22:34:25 +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:
@@ -66,6 +66,8 @@ func renderArchive(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if len(data) != 0 {
|
||||
w.Header().Set("Cache-Control", "max-age=86400")
|
||||
} else {
|
||||
w.Header().Set("Cache-Control", "max-age=60")
|
||||
}
|
||||
|
||||
if err := tmpl.ExecuteTemplate(w, "archive.html", params); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user