mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-18 14:54:24 +01:00
Lower Cache-Control values
This commit is contained in:
@@ -320,7 +320,9 @@ func render(w http.ResponseWriter, r *http.Request) {
|
|||||||
templateMapping[typ] = "other.html"
|
templateMapping[typ] = "other.html"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strings.Contains(typ, "profile") && len(renderableLastNotes) != 0) || (!strings.Contains(typ, "profile") && len(content) != 0) {
|
if strings.Contains(typ, "profile") && len(renderableLastNotes) != 0 {
|
||||||
|
w.Header().Set("Cache-Control", "max-age=3600")
|
||||||
|
} else if !strings.Contains(typ, "profile") && len(content) != 0 {
|
||||||
w.Header().Set("Cache-Control", "max-age=604800")
|
w.Header().Set("Cache-Control", "max-age=604800")
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set("Cache-Control", "max-age=60")
|
w.Header().Set("Cache-Control", "max-age=60")
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ func renderArchive(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(data) != 0 {
|
if len(data) != 0 {
|
||||||
w.Header().Set("Cache-Control", "max-age=86400")
|
w.Header().Set("Cache-Control", "max-age=3600")
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set("Cache-Control", "max-age=60")
|
w.Header().Set("Cache-Control", "max-age=60")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ func renderRelayPage(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(renderableLastNotes) != 0 {
|
if len(renderableLastNotes) != 0 {
|
||||||
w.Header().Set("Cache-Control", "max-age=604800")
|
w.Header().Set("Cache-Control", "max-age=3600")
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set("Cache-Control", "max-age=60")
|
w.Header().Set("Cache-Control", "max-age=60")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user