fix: bypass Data Cache on live park/ride pages so navigation shows fresh data
Build and Deploy / Lint, typecheck, test (push) Successful in 33s
Build and Deploy / Build & Push (push) Successful in 1m15s

The ride detail and park pages fetched with `next: { revalidate: 60 }`,
which is stale-while-revalidate. After hours of no traffic the Data Cache
held a morning snapshot; the first click served that stale value and only
the second request (e.g. a browser refresh) got the just-revalidated
payload. The endpoint also bundles live state with chart history, so one
stale fetch made the whole page wrong.

Switch the live-data fetches to `cache: "no-store"`. The calendar-month
fetch keeps its 5-min ISR since operating hours change slowly.
This commit is contained in:
2026-06-01 21:06:58 -04:00
parent 301ed797ea
commit 0dc84c7597
3 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ export default async function ParkPage({ params, searchParams }: PageProps) {
),
apiFetch<RidesResponse>(
`/api/parks/${id}/rides`,
{ revalidate: 60 },
{ noStore: true },
),
]);
+1 -1
View File
@@ -88,7 +88,7 @@ export default async function RideDetailPage({ params, searchParams }: PageProps
let res: Response;
try {
res = await fetch(`${getBackendUrl()}/api/parks/${id}/rides/${slug}`, {
next: { revalidate: 60 },
cache: "no-store",
});
} catch {
return <ErrorState parkId={id} parkName={park.name} />;