Next.js (Pages Router): Prefetching content in Next.js

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


In linking 2 pages with Next.js I mentioned how the Link Next.js component can be used to create links between 2 pages, and when you use it, Next.js transparently handles frontend routing for us, so when a user clicks a link, frontend takes care of showing the new page without triggering a new client/server request and response cycle, as it normally happens with web pages.

There’s another thing that Next.js does for you when you use Link.

As soon as an element wrapped within <Link> appears in the viewport (which means it’s visible to the website user), Next.js prefetches the URL it points to, as long as it’s a local link (on your website), making the application super fast to the viewer.

This behavior is only being triggered in production mode (we’ll talk about this in-depth later), which means you have to stop the application if you are running it with npm run dev, compile your production bundle with npm run build and run it with npm run start instead.

Using the Network inspector in the DevTools you’ll notice that any links above the fold, at page load, start the prefetching as soon as the load event has been fired on your page (triggered when the page is fully loaded, and happens after the DOMContentLoaded event).

Any other Link tag not in the viewport will be prefetched when the user scrolls and it

Prefetching is automatic on high speed connections (Wifi and 3g+ connections, unless the browser sends the Save-Data HTTP Header.

You can opt out from prefetching individual Link instances by setting the prefetch prop to false:

<Link href="/a-link" prefetch={false}>
  <a>A link</a>
</Link>

Lessons in this unit:

0: Introduction
1: Getting started with Next.js (Pages Router), a tutorial
2: How to install Next.js
3: How I set up a Next.js project structure
4: Linking two pages in Next.js using Link
5: How to use the Next.js Router
6: Dynamic content in Next.js with the router
7: ▶︎ Prefetching content in Next.js
8: How to programmatically change a route in Next.js
9: View source to confirm SSR is working in Next.js
10: Feed data to a Next.js component using getInitialProps
11: Styling Next.js components using CSS
12: Next.js: populate the head tag with custom tags
13: How to use Next.js API Routes
14: How to get cookies server-side in a Next.js app
15: Deploying a Next.js application on Now
16: Deploying a Next.js app in production