mirror of
https://github.com/SoPat712/maisie-heardle.git
synced 2026-07-02 14:26:43 -04:00
fix(stats): avoid cached play counter reads
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user