From f2b36c40d65311da341aa8e391949b9f4fe58b19 Mon Sep 17 00:00:00 2001 From: Florent Tapponnier <160007691+Flotapponnier@users.noreply.github.com> Date: Thu, 13 Aug 2026 17:48:07 +0200 Subject: [PATCH] fix(hl-history): raise staleness threshold to 2h (was 10min) --- src/lib/hl-builder-stats.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/hl-builder-stats.ts b/src/lib/hl-builder-stats.ts index c4513369..dcf6e8ee 100644 --- a/src/lib/hl-builder-stats.ts +++ b/src/lib/hl-builder-stats.ts @@ -779,7 +779,9 @@ function toCompactFrontend( * unstable_cache TTL is 1h rather than 60 s — no need to fan out * 20 range queries against Prom on every ISR cycle. */ async function fetchHlHistoryRaw(): Promise { - const snapshot = await readCohortSnapshot(HL_HISTORY_KEY); + // 2h: history is daily-stepped data, 10-min default is too aggressive and + // causes unnecessary 200-query Prom rebuilds on every staleness window. + const snapshot = await readCohortSnapshot(HL_HISTORY_KEY, 2 * 60 * 60 * 1000); if (snapshot) return snapshot.data; const fresh = await fetchHlHistoryFresh(); if (fresh) {