perf(web): cache dashboard tile responses #46

Merged
vince merged 1 commit from codex/dashboard-tile-cache into main 2026-06-20 14:09:57 +02:00
Owner

Summary

Adds route-level dashboard tile caching with in-flight request coalescing and short HTTP cache hints.

Why

Multiple clients or refresh cycles should not repeatedly hit the same upstream datasource when a fresh tile result is already available or currently loading.

Changes

  • Add an in-memory server tile cache keyed by structured tile references.
  • Coalesce concurrent requests for the same tile key into one upstream resolution.
  • Apply default TTL buckets: telemetry 15s, services 30s, status aggregates 30s, weather modules 10m, static status 5m.
  • Add Cache-Control: private, max-age=5, stale-while-revalidate=30 to tile route responses.
  • Add route tests for cache reuse, TTL expiry, in-flight coalescing, cache-key delimiter safety, and HTTP cache headers.

Testing

  • bun run check
  • bun run test
  • Independent review: no blocking findings after structured-key and TTL coverage updates.

Notes

  • Cache is process-local in memory.
  • packages/ui is untouched.
## Summary Adds route-level dashboard tile caching with in-flight request coalescing and short HTTP cache hints. ## Why Multiple clients or refresh cycles should not repeatedly hit the same upstream datasource when a fresh tile result is already available or currently loading. ## Changes - Add an in-memory server tile cache keyed by structured tile references. - Coalesce concurrent requests for the same tile key into one upstream resolution. - Apply default TTL buckets: telemetry 15s, services 30s, status aggregates 30s, weather modules 10m, static status 5m. - Add `Cache-Control: private, max-age=5, stale-while-revalidate=30` to tile route responses. - Add route tests for cache reuse, TTL expiry, in-flight coalescing, cache-key delimiter safety, and HTTP cache headers. ## Testing - bun run check - bun run test - Independent review: no blocking findings after structured-key and TTL coverage updates. ## Notes - Cache is process-local in memory. - packages/ui is untouched.
vince added 1 commit 2026-06-20 14:09:46 +02:00
vince merged commit 9aa30b07db into main 2026-06-20 14:09:57 +02:00
Sign in to join this conversation.
No description provided.