fix(stats): avoid cached play counter reads

This commit is contained in:
2026-06-30 17:23:48 -04:00
parent 5f7c34a721
commit 8a28a647c3
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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'
}
}
);