1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-12-02 20:22:52 +00:00

dynamic iterations

This commit is contained in:
Laura
2025-08-23 15:19:43 +02:00
parent bbe5a54ce1
commit d026c57ad2
8 changed files with 50 additions and 24 deletions

View File

@@ -64,8 +64,10 @@ func cache(next http.Handler) http.Handler {
path := strings.ToLower(r.URL.Path)
ext := filepath.Ext(path)
if ext == ".svg" || ext == ".ttf" || strings.HasSuffix(path, ".min.js") || strings.HasSuffix(path, ".min.css") {
if ext == ".png" || ext == ".svg" || ext == ".ttf" || strings.HasSuffix(path, ".min.js") || strings.HasSuffix(path, ".min.css") {
w.Header().Set("Cache-Control", "public, max-age=3024000, immutable")
} else if env.Debug {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
}
next.ServeHTTP(w, r)