You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tanstack: no single-flight on cache MISS/STALE; HITs queue behind SSR in the same isolate (2–4 s TTFB on HIT) #663
On deco-sites/oficina-tanstack (@decocms/tanstack 7.77.2, workers.dev preview), measured with curl (Oct 8, 2026):
Scenario
n
mean TTFB
max
sequential HIT, spaced 3 s
30
0.20–0.57 s
0.42 s
MISS (any route)
50
2.98 s
7.17 s
12 concurrent, same path, all HIT
68
0.50–0.80 s
2.71 s (staircase: 0.19 / 0.5 / 1.5 / 2.6 s)
No single-flight on MISS/STALE.workerEntry.ts has no per-cacheKey in-flight dedupe in this version, so N concurrent MISSes of the same path run N SSRs.
HITs queue behind SSR/revalidation in the same isolate.revalidateInBackground (via waitUntil, ~l.2998-3002) and concurrent MISS renders hold the single-threaded isolate; HITs that arrive meanwhile wait (the staircase above, and "x-cache: HIT" responses at 2–4 s).
Cache API is per-colo; on workers.dev one client was served by 5 colos (GRU, GIG, EWR, ATL, MIA), multiplying MISSes. (Platform; may differ under a zone with Tiered Cache.)
Proposal
Single-flight per cache key for MISS and STALE revalidation (one promise per key in isolate memory).
Yield during background revalidation (or cap concurrency) so HITs are not starved.
Emit Server-Timing for SSR, loaders and cache.match so sites can separate CPU from upstream I/O.
Found while validating deco-sites/oficina-tanstack#479 (QA-165).
Activity