Skip to content

perf(api): cache /api/observers/metrics/summary server-side (0.9 s warm, 2.7–4 s cold; now used by three views) #506

Closed

Description

@dborup

Follow-up from the #498 review (F2).

GET /api/observers/metrics/summary?window=1h takes about 0.9 s warm and 2.7–4 s cold on staging, and about 2.8–3.2 s cold on production. Since #481 and #498 it is used by:

  • the observer list;
  • the RF Health tiles;
  • the observer detail page (which no longer blocks on it).

Proposal:

  • Add a short server-side cache (for example 30 s, keyed by window) with singleflight, so concurrent misses do not stampede.
  • Keep the cache bounded and read-only.
  • Optionally use stale-while-revalidate.
  • Measure cold and warm latency before and after on staging.

Activity

  1. dborup commented on Oct 20, 2026

    @dborup
    OwnerAuthor

    Fixed by #512 (merged as cff464636dbfac5ab82289e2bf185ed5c15ca1f2).Fixed by #512: /api/observers/metrics/summary is cached server-side with bounded keys and singleflight (APPROVE with nits, CI green).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions