From 372eef72f402ed5b76fc1e54d625d4703429c93c Mon Sep 17 00:00:00 2001 From: spiral Date: Sat, 3 Dec 2022 11:59:36 +0000 Subject: [PATCH] fix(web-proxy): fix dashboard cache headers, force path lowercase in metrics --- services/web-proxy/main.go | 2 +- services/web-proxy/util.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web-proxy/main.go b/services/web-proxy/main.go index e454a4c3..e305a2ec 100644 --- a/services/web-proxy/main.go +++ b/services/web-proxy/main.go @@ -111,7 +111,7 @@ func modifyDashResponse(resp *http.Response) error { (strings.HasSuffix(r.URL.Path, ".js") || strings.HasSuffix(r.URL.Path, ".css") || strings.HasSuffix(r.URL.Path, ".map")) if is_dash_static_asset && resp.StatusCode == 200 { - resp.Header.Add("Cache-Control", "max-age: 604800") + resp.Header.Add("Cache-Control", "max-age=31536000, s-maxage=31536000, immutable") } return logTimeElapsed(resp) diff --git a/services/web-proxy/util.go b/services/web-proxy/util.go index 780139e5..be001f2e 100644 --- a/services/web-proxy/util.go +++ b/services/web-proxy/util.go @@ -40,6 +40,8 @@ func cleanPath(host, path string) string { return "" } + path = strings.ToLower(path) + if !(strings.HasPrefix(path, "/v2") || strings.HasPrefix(path, "/private")) { return "" }