Say you are trying to ship a Next.js app that scores green across all four Core Web Vitals metrics. You have already run Lighthouse, installed @next/bundle-analyzer, and read the official docs. Yet your LCP still hovers around 3.5 seconds on a mid-range Android device, and your INP occasionally spikes past 300 milliseconds. You are not alone—this is the most common situation we see in performance audits. The gap between knowing the principles and applying them to a real Next.js codebase is wider than most tutorials admit.
This guide ranks the five optimizations that consistently produce the largest measurable improvements for Next.js applications. They are ordered by impact, not by how easy they are to implement. You will see that number four is painful to adopt, and number three is where most teams unknowingly lose the most time.

5. Route-Level Code Splitting with Dynamic Imports
Next.js gives you file-based code splitting for free. Every page in the app or pages directory becomes its own JavaScript chunk. That much works out of the box. The problem appears when a single page pulls in heavy client-side libraries—charting tools, date pickers, or rich text editors—that are imported at the top of the file. Those dependencies land in the page’s main bundle, and the browser must download and parse them before the page becomes interactive.
Dynamic imports solve this by deferring the load of a component until it is needed or visible. The pattern is straightforward:
import dynamic from 'next/dynamic'
const Chart = dynamic(() => import('../components/RevenueChart'), {
ssr: false,
loading: () => <div className="h-64 animate-pulse bg-gray-100" />,
})
Two details matter here. First, set ssr: false for components that only exist in the browser—this prevents a server-side render that adds nothing but extends the HTML payload. Second, provide a meaningful loading state. A blank area that pops in content later hurts your CLS score; a placeholder with a reserved height keeps layout stable.
For components that do not need to render until the user scrolls to them, use next/dynamic with the loading option, or pair it with a React.lazy wrapper inside a Suspense boundary. The same technique applies to third-party widgets like embedded maps or chat bubbles. Each one you defer removes weight from the critical chunk.
What you gain: a smaller initial JavaScript payload, faster time to interactive, and better INP on low-end devices. This is the cheapest win on the list, so start here if your bundle analysis shows large page-level chunks.
4. The Image Component and the fetchPriority Attribute
The Next.js next/image component has been the default recommendation for years, and for good reason. It handles responsive sizing, WebP conversion, and lazy loading automatically. The part most teams miss is the fetchPriority prop. By default, Next.js does not tell the browser which image matters most. Every image gets similar treatment, and the browser’s heuristics can prioritize the wrong one.
Your hero image—the one that determines LCP—needs fetchPriority="high". Images below the fold should get fetchPriority="low". Consider this pattern:
<Image
src="/hero-image.webp"
alt="Product overview"
width={1200}
height={630}
priority
fetchPriority="high"
className="w-full h-auto"
/>
The priority prop already tells Next.js to preload the image and skip lazy loading, but fetchPriority is what signals the browser’s resource scheduler. Both together ensure the hero image starts downloading as early as possible, which directly reduces LCP.
The reverse applies to carousel slides, background details, or gallery thumbnails. Mark them fetchPriority="low" so they never compete with critical resources. Testing shows that this single attribute change can shave 300 to 500 milliseconds off LCP on slower 4G connections when the hero image is large.
One warning: do not mark every image as high priority. The browser will ignore the hint if everything is shouting, and you risk degrading the very metric you are trying to improve. Reserve fetchPriority="high" for the single image that drives LCP, and one more at most for critical above-the-fold content.
3. Server Components and the Disappearing Client Bundle
This is the category where most Next.js apps leak performance without anyone noticing. Even with dynamic imports and good image handling, a typical page can ship 200 kilobytes of client-side JavaScript that never needed to run in the browser. The root cause is a habit: defaulting every component to 'use client' or importing client libraries at the module scope.
App Router’s Server Components change the rules. Any component that does not use state, effects, or browser APIs should stay a Server Component. It renders on the server and sends only HTML to the client. No JavaScript, no hydration, no parse cost. The shift is architectural, not cosmetic.
Start by auditing your components. Open each one and ask: does this need useState, useEffect, onClick, or useRef? If the answer is no, remove the 'use client' directive. The library imports inside that component also move to the server bundle, which does not reach the browser at all.
The harder case is when a component needs interactivity but most of its logic does not. Split it: keep the outer shell as a Server Component, then pass the interactive part into a small client child. This is called the “server/client boundary” pattern, and it is the single most effective way to shrink hydration costs in an App Router project.
For example, a blog post page with a comment form can load the article text entirely on the server. Only the form itself—its button, input, and submit handler—needs to be a client component. The article body, the author bio, and the related posts list all render as static HTML. In practice, this drops hydration payloads by 60 percent or more on content-heavy pages.
The cost is discipline. It requires reorganizing component trees and resisting the convenience of 'use client' at the top of every file. Teams that make this investment consistently report INP improvements in the 20 to 40 percent range, because there is far less JavaScript to parse and execute on the main thread.
2. Eliminating Layout Shift with Explicit Dimensions and Reserved Slots
CLS is the easiest Core Web Vital to fix in Next.js, yet it remains the most commonly violated. The causes are predictable: images without width and height, fonts that swap in with different metrics, and content that loads into the page after the initial render.
The image component from next/image already requires width and height, which solves the first cause. But two other sources of shift are specific to Next.js patterns.
The first is font loading. Next.js’s next/font component optimizes font delivery by default, but it does not automatically reserve space for the text that will use the font. If your heading font has a larger line height than the fallback, the page shifts when the webfont arrives. Use the adjustFontFallback option and set explicit line-height values in your global CSS that match the webfont’s metrics. Test this by throttling your network to Slow 3G and watching the heading area; if the text jumps, your font fallback metrics are off.
The second source is dynamic content that mounts asynchronously—banners fetched from a CMS, notification bars, or cookie consent widgets. Each one pushes existing content down when it appears. Reserve a predictable slot for them. For a cookie banner, render a fixed-height placeholder at the bottom of the viewport. For CMS-driven banners, set min-height on the container so content does not move when the text loads.
Track CLS in real user monitoring rather than just lab tests. Field data often shows CLS problems that Lighthouse misses, because real users scroll, resize, and interact in ways a synthetic test does not capture. Any single layout shift above 0.05 is worth investigating.
1. INP Triage: The Main Thread Is the Bottleneck
Interaction to Next Paint has replaced First Input Delay as the Core Web Vital that measures responsiveness. INP captures the full duration from a user interaction—click, keypress, tap—to the next frame painted. In Next.js, the biggest INP killers are long-running tasks on the main thread and hydration work that competes with user input.
Start by profiling in your browser’s DevTools. Record a session, perform the interactions your users perform most (submitting a form, opening a menu, typing in a search box), and examine the Performance tab. Look for tasks exceeding 50 milliseconds. Each one delays the next paint and stacks toward your INP score.
The most common offender in Next.js is a click handler that triggers a state update causing a large re-render. If that re-render includes an expensive list, a chart, or a data-heavy table, the main thread freezes for hundreds of milliseconds.
Three fixes work here. First, memoize expensive components with React.memo and wrap callbacks in useCallback so re-renders do not cascade through the tree. Second, defer non-critical work to requestIdleCallback or setTimeout so input handling wins the race for the main thread. Third, if a heavy operation must block, break it into smaller chunks with setTimeout between steps, or move it to a Web Worker entirely.
A practical example: a search page that filters a list of 5,000 items. Filtering on every keystroke in the main thread is painful. Debounce the input with a 150-millisecond delay, then run the filter and update the DOM. If the filter itself takes more than 50 milliseconds, move it to a Web Worker and pass the filtered results back via a message. The user sees a responsive input field, and INP stays green.
Component hydration also competes with INP. When a page loads, the browser hydrates all client components. If the user clicks during hydration, the main thread is already busy, and the interaction waits. The solution is to minimize the number of client components (see item three) and, where necessary, defer non-critical hydration until after the page is idle. The next/dynamic loading option and React’s startTransition both help here.
The Ranking at a Glance
| Rank | Optimization | Primary Metric Solved | Implementation Effort | Impact |
|---|---|---|---|---|
| 5 | Route-Level Dynamic Imports | TBT, INP | Low | Moderate |
| 4 | fetchPriority on Images | LCP | Low | Moderate |
| 3 | Server Component Refactor | INP, TBT, LCP | High | High |
| 2 | CLS Prevention (Fonts & Slots) | CLS | Medium | High |
| 1 | Main Thread Triaging for INP | INP | Medium | Highest |
Work down this list in order. Items five and four take an afternoon and give you immediate wins. Item three requires a longer refactor but pays off continuously. Item two is mostly a matter of discipline during development. Item one demands ongoing profiling, but it is where the most stubborn performance problems live.
The goal is not to apply every technique to every page. Pick the pages that matter most to your business—your landing page, your product page, your checkout flow—and apply this ranking on those first. Measure before and after with field data from CrUX, not just Lighthouse. The numbers will tell you when to stop optimizing and start shipping.
Related guides: Core Web Vitals for Ecommerce Product Pages: Separating Performance Fact from Fiction, Core Web Vitals in Single-Page Applications: Why the Basics Aren’t Enough, and Core Web Vitals Optimization for Finance and Banking Websites: A Troubleshooting Checklist.
🔗 Recommended Reading
- How to Enable Browser Caching on Your Website: A Beginner's Step-by-Step Tutorial
- Web Performance Monitoring Tools Compared: Lighthouse, PageSpeed Insights, and WebPageTest
- CDN vs. Origin Server: Which to Optimize First for Latency
- Common Mistakes That Break Web Font Performance and How to Fix Them
- Site Speed Optimization for Fintech Websites: Balancing Security, Compliance, and Performance