Stop every page switch waiting on a redirect and a 2s fade-in

Performancekamo-marketing
Shipped
August 19, 2026 at 7:27 AM UTC
Author
Kamo
Commit
013faf1

The prerendering work in 4fae924 fixed the server and the router, and the site still felt like it took 1-2 seconds to change pages. It was never the network. Two things were doing it, and both are invisible to a build, a type check and a lint run — hence **************** wired into prebuild so the image build (and therefore the deploy) fails on a regression. FULL PAGE LOADS. 30 files imported next/link directly, which does not add the /<locale> prefix, so their hrefs were unprefixed and the locale middleware answered each one with a 307. Next then discards a redirected RSC response as invalid and refetches the new location (fetch-server-response.js), and the prefetch for such a link returns the redirect rather than page data — so the click began with an empty router cache no matter what the server did. Worse, a handful of internal links were bare <a>/<motion.a> tags, which bypass the router altogether and re-parse the whole bundle: one of them was the Contact icon in the shared footer, i.e. a hard navigation available on all 179 pages. The built HTML went from 184 unprefixed internal links to 0, across 8414 links. THE PAGES FADED THEMSELVES IN. Each page ships 40-88 elements at opacity:0 and reveals them on mount, so the animation, not the transfer, decided when a page looked ready. With `delay: index * 0.1` and a 0.6s duration the tenth card in a list finished 1.6s after the click; fixed delays reached 1.2s. Entrance transitions are now capped at 0.3s with staggers of 0.03s (cap 0.15s) — 135 durations, 21 delays and 43 staggers retuned — which puts worst-case time-to- readable at ~0.45s. The 16 ambient loops (anything with `repeat`) are untouched; a drifting gradient is background, not content someone is waiting for. ScrollReveal additionally pinned an inline scroll-linked opacity over its own animate target, so content faded back out past 70% of its scroll range and its "-100px" viewport inset kept the first screenful hidden until a scroll.

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