mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 03:40:01 -06:00
Force web asset re-validation (on last modification date)
This commit is contained in:
@@ -169,7 +169,7 @@ func (p Phoenix) Static(ttl int) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%s", strconv.Itoa(ttl)))
|
||||
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)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ func Static(root string, fs http.FileSystem, ttl int) func(http.Handler) http.Ha
|
||||
if strings.HasPrefix(r.URL.Path, path.Join(root, "api")) {
|
||||
next.ServeHTTP(w, r)
|
||||
} else {
|
||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%s", strconv.Itoa(ttl)))
|
||||
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)
|
||||
static.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user