From 42ce22e83ecb6f121aae94aa9bbc34f4292e0656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Fri, 27 Jun 2025 17:48:40 +0800 Subject: [PATCH] adjust cache-control for history api it seems like there's a bug in the data calculations so many servers get the too long maximum cache time; make it shorter while we debug --- server/history.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/history.go b/server/history.go index dff182b..6a8566d 100644 --- a/server/history.go +++ b/server/history.go @@ -399,12 +399,12 @@ func setHistoryCacheControl(c echo.Context, history *logscores.LogScoreHistory) // cache for longer if data hasn't updated for a while; or we didn't // find any. (time.Now().Add(-8 * time.Hour).After(history.LogScores[len(history.LogScores)-1].Ts)) { - hdr.Set("Cache-Control", "s-maxage=3600,max-age=1800") + hdr.Set("Cache-Control", "s-maxage=260,max-age=360") } else { if len(history.LogScores) == 1 { hdr.Set("Cache-Control", "s-maxage=60,max-age=35") } else { - hdr.Set("Cache-Control", "s-maxage=240,max-age=120") + hdr.Set("Cache-Control", "s-maxage=90,max-age=120") } } }