November 19, 2026
9 min read
Performance
Next.js
Frontend

Next.js Performance: A Practical Guide (2026)

Next.js performance fixes that move Core Web Vitals: images, fonts, third-party scripts and caching, with real code from our own site and how we measure it.

DesignDuck Team
DesignDuck TeamEngineering
Next.js Performance: A Practical Guide (2026)
Have a website or product you want built right?DesignDuck is a code-first design and development team in New Delhi working with clients worldwide. Start with a free discovery call and get a fixed-price quote.

Poor Next.js performance is rarely Next.js's fault. Your site is slow because of one oversized hero image, a third-party script that grabs the main thread before the page is usable, and a layout that jumps while fonts and images arrive. None of that needs a rewrite, and all of it shows up in your Core Web Vitals.

Below are the fixes in the order we reach for them, with code from the site you are reading. It runs Next.js 16 and the App Router, and we checked every API here against the docs bundled with that version.


What you are actually measuring

Google's Core Web Vitals are three metrics, each judged at the 75th percentile of real page loads, split by mobile and desktop:

  • Largest Contentful Paint (LCP): 2.5 seconds or less. How fast the main content appears.
  • Interaction to Next Paint (INP): 200 milliseconds or less. How fast the page responds to taps and clicks.
  • Cumulative Layout Shift (CLS): 0.1 or less. How much the layout jumps.

INP is the newer one. web.dev describes it as a stable Core Web Vital that replaced First Input Delay, so older guides that tell you to chase FID are out of date.

A page passes only if all three are within range at the 75th percentile. That is why a fast average can still fail: a quarter of your visitors, usually on slower phones, set the grade.


Lab data and field data are different things

PageSpeed Insights shows two kinds of result, and mixing them up causes most of the arguments about "our score".

Lab data comes from Lighthouse, which loads your URL once in a simulated environment: a mid-tier mobile device on a mobile network for the mobile test. It is repeatable and good for debugging, but Google notes it can miss real-world bottlenecks.

Field data comes from the Chrome User Experience Report (CrUX), collected from real users over a rolling 28-day period. It covers LCP, INP and CLS, and it is what the thresholds above are really about. A new or low-traffic page may not have enough samples, in which case PageSpeed Insights falls back to origin-level data, and if there is not enough of that either, it shows no field data at all.

Our habit: use Lighthouse to find problems while building, then check field data after launch to see whether real visitors agree. A small site often has no field data for individual pages, and that is fine. It just means the lab run is the only evidence you have, so treat it as a guide, not a verdict.

How this site scores

We ran our own site through PageSpeed Insights on 28 November 2026, mobile, which emulates a Moto G Power on a throttled slow 4G connection. Neither page had field data yet, so these are lab numbers only.

PagePerformanceLCPTBTCLS
Home page671.4 s2,020 ms0.002
A blog post913.5 s100 ms0.002

Two different problems, which is the point of measuring more than one page. The home page paints fast but blocks the main thread for two seconds, which points at JavaScript: the animated hero, the motion library and our analytics all run on that page. The blog post is light on JavaScript, but its cover image arrives late, at 3.5 seconds, outside the 2.5-second line. PageSpeed also flagged about 397 KiB of unused JavaScript on the blog post. Layout shift is close to zero on both. We have not fixed these yet. The sections below are the list we are working from, and we will update this post with the before and after when we do.


Images: fix the LCP element first

On most marketing and blog pages, the largest element is an image. Fix that one image and LCP often follows.

next/image resizes, serves modern formats and lazy-loads by default. The one thing you must do yourself is tell it which image is above the fold. Here is the cover image from our blog post header, components/blogs/blog-header.tsx:

components/blogs/blog-header.tsx
<Image
  src={page.data.previewImage}
  alt={page.data.title}
  width={1200}
  height={852}
  sizes="(min-width: 90rem) 656px, (min-width: 64rem) 46vw, 100vw"
  fetchPriority="high"
  className="h-full w-full object-cover"
  preload
/>

That preload prop is new. Since Next.js 16, priority is deprecated in favour of preload, which does the same thing under a clearer name: it inserts a <link> in the <head> so the browser starts fetching the image early. The docs also say that in most cases loading="eager" or fetchPriority="high" is the better choice, and that you should not use preload when several different images could be the LCP element depending on viewport. Our header used priority until we refreshed this post, then preload on its own. PageSpeed still failed its "LCP request discovery" check, and the reason is in the Next.js source: preload adds the <link> and makes the image eager, but fetchpriority="high" only lands on the <img> if you pass fetchPriority yourself. So the header now sets both.

It also has sizes. Without it, next/image only offers a 1x and a 2x file, and on a 2x screen the browser asked for a 3840-pixel version of a cover that is 1200 pixels wide. The height now matches the file, 1200 by 852, so the space reserved for the image has the right shape.

On our work page, where either of the first two project images can be the largest element depending on screen size, those two use loading="eager" with fetchPriority="high". The blog index is similar: any of the three covers in the first row can be the largest element on desktop. Only the first gets fetchPriority="high". The next two load eagerly at normal priority. On a phone only one card is on screen, and we did not want the other two jumping the queue ahead of it. The scores in the table above were measured before any of these changes.

Other image habits that matter:

  • Always set width and height (or use fill with a sized parent). That reserves space and keeps CLS near zero.
  • Preload the hero only. Preloading everything cancels the benefit.
  • Control the source file. The blog covers on this site are rendered by a script (scripts/blog-covers) into WebP files in public/assets/blog, so we know exactly what gets served instead of hoping an upload was sized sensibly.
  • Restrict remote sources. next.config.mjs allows only images.unsplash.com through remotePatterns and limits qualities to 50 and 75, so the optimizer cannot be pointed at arbitrary images or asked for arbitrary quality values.

Fonts: self-host and ship only what you use

Web fonts hurt twice: an extra network request, and text that either flashes or shifts when the font swaps in. next/font self-hosts the file at build time and removes the external request.

This site uses next/font/local in app/layout.tsx with files committed to the repo:

app/layout.tsx
const inter = localFont({
  src: "./fonts/Inter-latin-variable.woff2",
  variable: "--font-inter",
  weight: "100 900",
  style: "normal",
  display: "swap",
});

Two choices are worth copying. The files are Latin-only subsets, so visitors do not download glyphs for scripts we never display. And Inter is one variable font file covering every weight instead of a separate file per weight. The one exception is DM Mono, which ships as three static weights (300, 400, 500) because that is how we got it. We have not measured whether a variable version would be smaller, so we will not claim it.

If you use Google Fonts instead, next/font/google does the same self-hosting for you. Either way, never link a font stylesheet from a third-party domain in your <head>.


Third-party scripts: the usual INP and LCP thief

Your own code is rarely the problem. Analytics, chat widgets, tag managers and booking embeds are. Each one adds JavaScript that competes with your page for the main thread, and a busy main thread is what makes taps feel slow.

next/script gives you four strategies, per the Script docs: beforeInteractive, afterInteractive (the default), lazyOnload, which loads during browser idle time, and an experimental worker. Use lazyOnload for anything the first paint does not need. For a React component, next/dynamic splits it into its own chunk so it ships only when rendered (see the lazy loading guide).

Loading a heavy widget only when it is needed looks like this:

components/chat-launcher.tsx
"use client";

import dynamic from "next/dynamic";
import Script from "next/script";

// Own chunk, fetched only when this component renders.
const ChatPanel = dynamic(() => import("./chat-panel"), { ssr: false });

export function ChatLauncher() {
  return (
    <>
      <ChatPanel />
      {/* Loads during browser idle time, after the page is usable. */}
      <Script src="https://example.com/widget.js" strategy="lazyOnload" />
    </>
  );
}

This is an illustrative example, not a file from our repo, and ssr: false is only allowed inside a Client Component, as the lazy loading docs note. Here is what this site actually does, including the part that is not a clean win:

  • Google Tag Manager is off. We removed it from app/layout.tsx on 26 November 2026. The old tag is commented out in place. Nothing loads that we do not use.
  • Cal.com starts on click. The booking embed is initialised inside a click handler in lib/cal.ts, through getCalApi(), so it loads the scheduler only when someone asks to book. The small wrapper package is loaded with a dynamic import() on that first click too, so nothing from Cal.com is in the initial page JavaScript.
  • PostHog waits for the first interaction. instrumentation-client.ts loads the library only on a visitor's first mouse movement, click, tap, key press, scroll or wheel, with no timed fallback, and session recording starts only after a click, tap, key press or wheel. Calls made before it loads are queued and replayed. The trade-off is that a visitor who never interacts is not counted. Requests go through a first-party /ingest rewrite in next.config.mjs, which keeps ad blockers from dropping events. It is not a speed optimisation, and it does not make the script free.

Every script has a price. Pick one analytics tool and delete the ones nobody reads.


Rendering and caching: do the work before the visitor arrives

The fastest request is one where the HTML already exists. In the App Router, a route with no dynamic data is prerendered at build time, and you can refresh it on a timer with a route segment config. Our blog uses exactly that:

app/blog/[id]/page.tsx
export const dynamicParams = false;
export const revalidate = 300;

export function generateStaticParams(): { id: string }[] {
  // one entry per published post
}

Every post is prebuilt, unknown slugs return 404, and each page is re-checked at most every 300 seconds. That window exists because posts publish on a schedule (lib/blog-schedule.ts), and a page rendered before a post's publish time has to go stale quickly. See the incremental static regeneration guide for the full model, including on-demand revalidation with revalidatePath when you want a change live now.

A CDN is not a performance strategy by itself, and neither is the hosting logo on your stack diagram. The production site runs in Docker on our own Ubuntu server behind a reverse proxy, built with output: "standalone" so the image carries only what the server needs. Vercel is where we preview changes. The speed comes from the pages being prerendered, not from where the container lives. If you self-host, the Next.js self-hosting guide covers caching headers and the other things a platform would otherwise do for you.


Measure, fix one thing, measure again

A routine that works without any special tooling:

  1. Build and run production locally. next dev is not a performance environment. Use bun run build and then start the build, or the Docker image.
  2. Run Lighthouse in Chrome DevTools in an incognito window so extensions do not skew it. Read the LCP element it names, then fix that element first.
  3. Check the Performance panel for long tasks if INP is the problem. A task over 50 milliseconds on the main thread is where to look, and third-party scripts usually lead the list.
  4. Run PageSpeed Insights on the deployed URL and look for the field data section. If it is empty, you have no real-user evidence yet.
  5. Change one thing at a time. Otherwise you will not know what helped.

A single oversized hero image can cost more than ten micro-optimisations combined, so resist the urge to start with bundle analysis.


What we would skip

  • Rewriting to a different framework because a Lighthouse score is orange. The fixes above usually take hours.
  • Chasing 100. Past the point where Core Web Vitals pass for real users, extra lab points rarely change anything a visitor feels.
  • Splitting into services for speed. More network hops rarely make a page faster. We cover when a split is justified in Do you need microservices?

Keep it fast as you ship

Performance slips a little with every dependency you add. Put a Lighthouse run on your pull request checklist, and look at the numbers before you merge anything that adds a script or a large image.

If you would rather have this built in from the start, see our pricing or book a free discovery call.