From 31a70bbef246e39002a8720d288cdc9ff8c752fb Mon Sep 17 00:00:00 2001 From: DJP Date: Thu, 19 Mar 2026 14:07:03 -0400 Subject: [PATCH] fix: Add cache-busting to API fetch calls Prevents browser from caching API responses when changing date ranges, which caused stat cards to show stale data. Co-Authored-By: Claude Opus 4.6 --- public/js/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/app.js b/public/js/app.js index dfe053f..6905bec 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -37,7 +37,8 @@ const BASE_PATH = window.location.pathname.replace(/\/$/, ''); async function fetchAPI(endpoint) { const sep = endpoint.includes('?') ? '&' : '?'; - const res = await fetch(`${BASE_PATH}/api/${endpoint}${sep}${queryParams()}`, { headers: apiHeaders() }); + const url = `${BASE_PATH}/api/${endpoint}${sep}${queryParams()}&_t=${Date.now()}`; + const res = await fetch(url, { headers: apiHeaders(), cache: 'no-store' }); if (!res.ok) throw new Error(`API error: ${res.status}`); return res.json(); }