diff --git a/src/lib/HeardleGame.svelte b/src/lib/HeardleGame.svelte index 3db0314..d4c8fdd 100644 --- a/src/lib/HeardleGame.svelte +++ b/src/lib/HeardleGame.svelte @@ -275,7 +275,7 @@ async function loadGlobalGamesPlayed() { try { - const res = await fetch('/api/stats/games-played'); + const res = await fetch('/api/stats/games-played', { cache: 'no-store' }); if (res.ok) { const data = (await res.json()) as { count?: number }; globalGamesPlayed = data.count ?? 0; @@ -296,7 +296,7 @@ } try { - const res = await fetch('/api/stats/games-played?increment=1'); + const res = await fetch('/api/stats/games-played?increment=1', { cache: 'no-store' }); if (res.ok) { const data = (await res.json()) as { count?: number }; globalGamesPlayed = data.count ?? 0; diff --git a/src/routes/api/stats/games-played/+server.ts b/src/routes/api/stats/games-played/+server.ts index bf97c21..3f5fefd 100644 --- a/src/routes/api/stats/games-played/+server.ts +++ b/src/routes/api/stats/games-played/+server.ts @@ -11,7 +11,7 @@ export const GET: RequestHandler = async ({ url }) => { { count }, { headers: { - 'cache-control': increment ? 'no-store' : 'public, max-age=60, stale-while-revalidate=300' + 'cache-control': 'no-store' } } );