Skip to content
← All releases

Prefetches of prerendered pages are now served from the edge

When a <Link> to a prerendered page comes into view, Next.js prefetches the parts of the page that a navigation to it will need. Those prefetches are now answered by the edge, from the files next build wrote for them, the way a page's prerendered shell is sent. Your app does not start for them.

  • Your app does not run for them. They spend none of its Active CPU, and no cold start of your app holds one up.
  • Your middleware still runs first when its matcher covers the request, as it does for a page, so a prefetch is answered for the page the request lands on. The Active CPU your middleware spends on it is counted as it is for a page.

This covers static pages and the prerendered shells of pages with Partial Prerendering, for as long as a page is still the one the build wrote. A page that renders on every request, and one that has been regenerated or has gone stale since the build, is still prefetched from your app, which renders the parts with the page.

A deployment published before this change still sends its prefetches to your app; deploy again to bring it along. A prefetch answered by the edge carries x-arkor-edge: segment where it used to carry passthrough;reason=segment-prefetch. See Response headers.