- Lazy routes (code splitting); TanStack Query caching + dedupe + optimistic score writes.
- History list virtualised with
@tanstack/react-virtual+ infinite query. - Player avatars:
srcsetfor ui-avatars URLs; fixed dimensions (no CLS); lazy + async decode. - Video:
preload="metadata", poster, byte-range via API/R2 or CDN URLs. - CI enforces a bundle budget (
npm run size).
- Indexes on
players(session_id),score_events(player_id),sessions(owner_id). - Hyperdrive pools connections + caches reads at the edge.
GET /sessionsuses keyset/cursor pagination; edge KV cache (60s KV / 15s HTTP) - see SCALE.md.- Read replica path (documented): route read-only list/detail to a Neon replica via second Hyperdrive binding; writes on primary. See SCALE.md.
- Durable Object hibernation keeps idle rooms free. At very high fan-out, shard rooms or move to pub/sub.
- Structured JSON logs +
X-Trace-Id/cf-raycorrelation - see SCALE.md.