Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1.11 KB

File metadata and controls

24 lines (16 loc) · 1.11 KB

Performance notes

Frontend

  • Lazy routes (code splitting); TanStack Query caching + dedupe + optimistic score writes.
  • History list virtualised with @tanstack/react-virtual + infinite query.
  • Player avatars: srcset for 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).

Backend / data

  • Indexes on players(session_id), score_events(player_id), sessions(owner_id).
  • Hyperdrive pools connections + caches reads at the edge.
  • GET /sessions uses 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.

Realtime

  • Durable Object hibernation keeps idle rooms free. At very high fan-out, shard rooms or move to pub/sub.

Observability

  • Structured JSON logs + X-Trace-Id / cf-ray correlation - see SCALE.md.