mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-03 17:29:22 -05:00
don't cache the web index.html
This commit is contained in:
committed by
Florian Schade
parent
968d26f0d6
commit
fbf1eeb4c5
@@ -152,6 +152,13 @@ func (p Web) Static(ttl int) http.HandlerFunc {
|
||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%s, must-revalidate", strconv.Itoa(ttl)))
|
||||
w.Header().Set("Expires", expires)
|
||||
w.Header().Set("Last-Modified", lastModified)
|
||||
|
||||
if r.URL.Path == rootWithSlash || r.URL.Path == rootWithSlash+"index.html" {
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
|
||||
} else {
|
||||
w.Header().Set("Cache-Control", "must-revalidate")
|
||||
}
|
||||
w.Header().Set("SameSite", "Strict")
|
||||
|
||||
static.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user