From 1af0ec351d36b659d9073f957c35e1bba1b32005 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Fri, 3 Jul 2026 16:16:13 +0200 Subject: [PATCH] feat: add immutable cache policy for versioned static assets --- internal/server/static_delivery.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/server/static_delivery.go b/internal/server/static_delivery.go index fd3f00f1..a6ba0f3d 100644 --- a/internal/server/static_delivery.go +++ b/internal/server/static_delivery.go @@ -69,6 +69,8 @@ func staticCachePolicy(r *http.Request) string { return "public, max-age=31536000, immutable" } return "public, max-age=0, must-revalidate" + case strings.HasPrefix(path, "/static/assets/") && r.URL.Query().Get("v") != "": + return "public, max-age=31536000, immutable" case strings.HasPrefix(path, "/static/assets/") && isImagePath(path): return "public, max-age=86400" default: