Add an opt-in navigation timing probe behind ?perf=1

Chorekamo-marketing
Shipped
August 19, 2026 at 9:28 AM UTC
Author
Kamo
Commit
2da951d

Page switches still feel slow on production, and the server has been ruled out from the reporter's own machine: 55-122ms responses, x-nextjs-cache HIT, prefetch returning full page payloads with 74 chunk references, no redirects anywhere, and only two always-animating elements on a content page. Continuing to reason about the browser from the outside has not converged, so measure it instead. The probe splits click-to-readable into the places the time can actually be: Resource Timing for any ?_rsc= request the router still had to make (should be zero on a prefetch hit), Long Task total between click and paint for main-thread blocking, click-to-pathname-change for React's commit, and commit to the second animation frame for style/layout/paint. A large `paint` next to a small `block` means the blurs and gradients; the reverse means script. Gated so no ordinary visitor loads it: the gate renders nothing without ?perf=1 and the probe itself is a dynamic import. The flag is read from window.location in an effect rather than via useSearchParams(), because useSearchParams() forces a dynamic bailout and static prerendering is exactly what makes these navigations prefetchable — a diagnostic must not disable what it is measuring. Verified: the build still prerenders 187 of 189 routes. Remove this once the numbers point somewhere.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing