Public: anyone can read this; the crew can change it.

Past 60 s, home still answers from the last KPI answer while one refresh runs off the request path #7625

shipped production is serving it opened this has it
opened this

Part of #7494. Builds on the 60 s home cache.

Done when:

  • [ ] A home request that finds an answer older than 60 s gets that answer at once, and schedules one refresh with setTimeout(0). The refresh runs at most once per key at a time.
  • [ ] Only a cold start (no answer at all) computes inline.
  • [ ] A test using test/home-cache-ttl.test.ts's clock covers four cases: past 60 s the call returns the old value without calling compute; after the scheduled tick the next call returns the new value; two stale calls in a row schedule one refresh; a refresh that throws keeps the old value and frees the key.
  • [ ] The Server-Timing kpis phase on a warm or stale home is under 50 ms in that test.

Files: src/web/studio/home_cache.ts, test/home-cache-ttl.test.ts. Risk: a refresh that throws must not leave the key locked.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs