
- Next.js Image component defaults can actually destroy LCP if you forget priority props on hero assets.
- Server-Side Rendering (SSR) shifts the performance burden to TTFB when database queries inside getServerSideProps run sequentially.
- Web Font Loader and Next/Font can introduce invisible layout shifts and delays if preloading strategies are misconfigured.
- Edge caching on CDN nodes is required to prevent server rendering latency from tanking your Core Web Vitals.
Next.js adds client-side JavaScript execution overhead and hydration steps that do not exist in static HTML or traditional monoliths. If your hero image lacks the priority attribute, or if your server-side rendering logic has a high Time to First Byte (TTFB) due to un-cached API calls, the browser cannot render the main element quickly. Fixing LCP regressions after migrating to Next.js usually requires optimizing render-blocking resources, preloading hero elements, and caching SSR responses at the edge.
Why did my Largest Contentful Paint get worse after moving to Next.js?
It usually happens three weeks after the pull request gets merged. The engineering team celebrates dropping their legacy monolith, the product manager posts a victory message on LinkedIn, and then your rank tracking dashboard looks like a cliff. In our audits of client migrations, a large share of teams migrating to Next.js experience a sudden spike in Largest Contentful Paint (LCP) times on their highest-value template pages.
The site feels modern, page transitions look instantaneous to developers on M3 MacBooks, but Google Search Console starts flagging thousands of URLs as “Need Improvement” or “Poor.” If you are currently dealing with fixing LCP regressions after migrating to Next.js, you know how frustrating this is. The framework promises speed out of the box, yet your field data shows real users waiting seconds for the hero banner to show up.
Why Next.js causes hidden LCP regressions
Next.js introduces architectural patterns that fundamentally change how browsers receive and render critical content. In a traditional HTML stack, the browser receives raw markup, discovers an <img> tag in the first few hundred lines, and fetches it immediately.
When you move that page into React and Next.js, several hidden bottlenecks emerge:
- Default lazy loading: The
next/imagecomponent automatically lazy-loads assets by default. If your hero banner uses this component without explicit override props, Next.js strips standard preloading behavior. The browser defers fetching the image until after layout calculation completes. - Hydration dependency chains: While Server-Side Rendering (SSR) streams HTML to the client, the page may not settle into its final layout until the client-side JavaScript bundle downloads, parses, and executes. If your LCP element relies on client state or dynamic layout context, its render timing gets chained to your total JavaScript payload size.
- TTFB inflations from server data fetching: Data fetching functions like
getServerSidePropsblock the server from sending any HTML bytes until every backend API call inside that function resolves. A slow third-party API call or an unindexed database query directly adds to your Time to First Byte (TTFB), shifting your entire LCP timeline to the right.
Traditional HTML Flow:
[HTML Request] -> [HTML Stream Received] -> [Image Discovered] -> [Image Rendered] (Fast)
Un-optimized Next.js Flow:
[HTML Request] -> [getServerSideProps Blocks] -> [HTML Received] -> [JS Parsed] -> [Image Discovered] -> [Image Rendered] (Slow)

Diagnosing your exact bottleneck: TTFB vs element render delay
Before changing a line of code, you must isolate where the time is being spent. LCP is composed of four distinct sub-parts: Time to First Byte (TTFB), Resource Load Delay, Resource Load Duration, and Element Render Delay.
| LCP Sub-part | Typical Bottleneck in Next.js | Primary Diagnostic Tool |
|---|---|---|
| Time to First Byte (TTFB) | Slow getServerSideProps, un-cached edge execution, cold starts |
WebPageTest / Chrome DevTools Network Tab |
| Resource Load Delay | Missing priority prop on next/image, client-side fetching |
Chrome DevTools Performance Panel |
| Resource Load Duration | Uncompressed images, missing modern formats (AVIF/WebP) | Lighthouse / PageSpeed Insights |
| Element Render Delay | Hydration delays, render-blocking fonts, massive CSS bundles | Chrome Performance Trace (Main Thread) |
To map this in Chrome DevTools: 1. Open an Incognito window and navigate to your problematic URL. 2. Open DevTools, go to the Performance tab, check Web Vitals, and hit Record. 3. Reload the page and stop the recording once the page settles. 4. Click on the LCP marker in the Timings track and expand the summary tab in the bottom panel.
Look at the breakdown. If TTFB accounts for 60% of the total time, your frontend image optimizations will not solve the issue; you have a backend data fetching problem. If TTFB is fast (under 300ms) but Resource Load Delay spans a full second, your browser does not know the image exists early enough in the parsing cycle.
If you are also seeing drops in organic authority across folder restructures during your framework rewrite, read our guide on migrating nested subfolders without losing internal PageRank to ensure structural crawler paths remain intact alongside performance tuning.
Fixing next/image misconfigurations that ruin LCP
The single most common code-level culprit for Next.js LCP degradation is misusing the framework’s native image component.
Consider this standard implementation found in many production codebases:
// BAD: Default behavior causes lazy loading on hero elements
export default function Hero Banner({ data }) {
return (
<div className="hero-container">
<Image
src={data.heroImageUrl}
alt={data.heroTitle}
width={1200}
height={600}
/>
</div>
);
}
By default, Next.js outputs loading="lazy" on this image. The browser explicitly delays requesting this file until main thread scripts settle and layout bounds are computed. For a hero banner, this adds hundreds of milliseconds of unnecessary load delay.
Here is the corrected implementation:
// GOOD: Priority instructs Next.js to inject preloads and load instantly
export default function HeroBanner({ data }) {
return (
<div className="hero-container">
<Image
src={data.heroImageUrl}
alt={data.heroTitle}
width={1200}
height={600}
priority={true}
fetchPriority="high"
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 1200px"
/>
</div>
);
}
When you pass priority={true} (or simply priority), Next.js makes critical adjustments behind the scenes:
- It removes the loading="lazy" attribute from the HTML element.
- It automatically injects a <link rel="preload"> tag into the document <head> during server execution.
- It sets fetchpriority="high" on the generated <img> tag, signaling to the browser network stack that this asset should take precedence over scripts and non-critical stylesheets.

Taming server-side render latency and TTFB
If your diagnostic traces point to high TTFB, your React server architecture is holding up document delivery. In Next.js applications, this usually traces back to database queries or API chaining inside node middleware or data fetching hooks.
// BAD: Sequential await calls inflate TTFB
export async function getServerSideProps(context) {
const user = await fetchUser(context.req);
const product = await fetchProduct(context.params.id); // Waits for user
const banners = await fetchBanners(); // Waits for product
return { props: { user, product, banners } };
}
To collapse this server rendering timeline, execute independent data queries concurrently:
// GOOD: Parallel execution minimizes total server hold time
export async function getServerSideProps(context) {
const [user, product, banners] = await Promise.all([
fetchUser(context.req),
fetchProduct(context.params.id),
fetchBanners()
]);
return { props: { user, product, banners } };
}
Furthermore, if your content does not vary per user request, move away from pure dynamic SSR. Use Incremental Static Regeneration (ISR) or implement strict CDN cache-control headers.
If your deployment lives on Cloudflare or a similar edge architecture, serving cached HTML directly from edge nodes brings document TTFB down to double-digit milliseconds. For detailed instructions on maintaining high cache hit ratios without breaking application logic, see our technical breakdown on fixing slow TTFB on Cloudflare without breaking cache.
Managing web fonts to prevent text-based LCP shifts
When your LCP element is a large header text block (<h1>) rather than an image, font rendering behavior becomes your main failure point. If custom web fonts are not optimized, the browser hides text while waiting for font files to download (FOIT - Flash of Invisible Text) or switches fonts abruptly, causing layout shifts.
Next.js provides the next/font package, which automatically inlines font CSS definitions at build time and downloads font files alongside static assets.
| Font Delivery Method | Network Requests | Render Blocking Risk | Layout Shift Risk |
|---|---|---|---|
External CSS (fonts.googleapis.com) |
High (Multiple DNS/TLS handshakes) | High | High |
| Self-hosted standard CSS | Medium (Separate asset request) | Medium | Medium |
next/font/google or next/font/local |
Zero external requests (Inlined) | None | Low (Self-adjusting fallback metrics) |
To implement zero-latency font delivery, configure your primary sans-serif or serif font through next/font using local overrides or managed Google fonts:
// layout.tsx or _app.tsx
import { Inter } from 'next/font/google';
const inter = Inter({
subsets: ['latin'],
display: 'swap',
variable: '--font-inter',
preload: true,
});
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className={inter.variable}>
<body>{children}</body>
</html>
);
}
By specifying display: 'swap', you ensure the browser immediately renders text using a local system font while the primary web font loads. Because next/font automatically calculates fallback font size adjustments (via CSS size-adjust), the visual swap occurs without triggering layout shifts or resetting element paint timers.
Debugging hydration delays and client-side render shifts
A subtle form of LCP regression occurs when the initial HTML delivered by Next.js displays the hero element, but dynamic client script execution forces a re-render that replaces or shifts the layout after mount.
Common scenario: You display an LCP hero banner on the server. On the client, a React hook (useEffect) runs, checks client state (such as screen width or personalization tokens), and swaps the DOM node with a modern visual variant.
Time: 0ms -> Server HTML arrives (H1 painted - Initial LCP recorded)
Time: 800ms -> Client JS executes hydration
Time: 820ms -> useEffect runs, updates state, replaces H1 DOM node
Time: 850ms -> Chrome re-calculates LCP to the NEW component element!
Because Chrome tracks LCP continuously until user interaction (like scrolling or tapping) occurs, replacing or modifying the largest visible DOM node pushes your final LCP score out to the moment that client state update completes.
Rules for avoiding dynamic hydration re-paints:
- Never hide hero content behind client-side state: Ensure server-rendered HTML contains the exact structure, dimensions, and visual elements required for immediate painting.
- Avoid layout shifts from dynamic banners: Reserve explicit CSS container dimensions (
min-heightor aspect ratios) so that client-rendered secondary widgets do not push the LCP element down the viewport during hydration. - Defer non-critical third-party scripts: Move analytics, chat widgets, and marketing tags out of the critical rendering path using the
next/scriptcomponent withstrategy="lazyOnload".
Step-by-step resolution process for Next.js LCP issues
When tasked with repairing LCP scores across an enterprise Next.js codebase, follow this sequence to isolate and rectify defects systematically.
- Identify the true LCP element in field data: Pull Real User Monitoring (RUM) data or run PageSpeed Insights on affected templates to confirm whether the node is an
<img>, a CSS background image, or a text block. - Audit server timing: Run
curl -I -w "Time Total: %{time_total}\n" https://yourdomain.com/pageto check production TTFB. If response timing exceeds 400ms, optimize database queries, implement ISR, or configure edge caching layers. - Inspect image attributes: Check the source code of the LCP element on the rendered page. Ensure hero images carry
priority,fetchpriority="high", and propersizesdefinitions without relying on CSS default auto-scaling. - Inline critical CSS and eliminate render-blocking scripts: Verify that global CSS bundles are split naturally by page route, and move secondary JS utilities to asynchronous execution.
- Enforce explicit asset dimensions: Apply fixed width/height values or aspect-ratio styling to images, containers, and web font wrappers to freeze layout boundaries prior to asset download.
- Deploy to a staging environment and run comparison benchmarks: Use WebPageTest to run side-by-side comparative traces (3G throttling / Mobile viewport) against pre-fix production builds to verify LCP time reductions before pushing live.
Quick reference: Common Next.js LCP bugs and direct fixes
| Failure Pattern | Root Cause | Implementation Fix |
|---|---|---|
| Delayed hero image download | next/image lazy loading default |
Add priority prop to hero image component |
| High TTFB on dynamic routes | Un-cached dynamic rendering in getServerSideProps |
Move to ISR (revalidate) or apply CDN edge cache headers |
| Flash of Invisible Text (FOIT) | Un-optimized web font network fetch | Implement next/font with display: 'swap' |
| Late LCP candidate shift | Client state changing DOM tree post-hydration | Avoid conditional hooks that re-render top-fold elements |
| Slow asset processing | On-the-fly Next.js image optimization node bottlenecks | Offload image processing to dedicated CDN or bucket storage |
Common myths debunked
Myth 1: Server-Side Rendering automatically guarantees green Core Web Vitals
Many development agencies assume that moving from a client-side Single Page Application (SPA) to React SSR guarantees immediate improvements in performance metrics. In reality, SSR shifts rendering work from client devices to your backend servers. If your Node.js application server spends hundreds of milliseconds assembling markup or waiting on external microservices, your TTFB suffers dramatically. A slow TTFB directly penalizes LCP, turning SSR into a bottleneck rather than an optimization.
Myth 2: The next/image component fixes performance issues automatically
The next/image component provides built-in image optimization, format conversion, and responsive srcset generation, but it cannot guess page layout context. If developers omit explicit sizing, leave out sizes attributes, or forget to pass the priority flag to critical hero assets, next/image will happily apply lazy-loading defaults. This forces the browser to wait until client JavaScript runs before discovering hero image URLs, resulting in significantly higher LCP latency than a standard standard HTML <img> tag.
Myth 3: Static Site Generation (SSG) makes LCP immune to client-side degradation
While SSG provides near-instant TTFB from CDN edge layers, it does not make your application immune to frontend rendering issues. Heavy client-side JavaScript bundles, un-optimized custom fonts, aggressive dynamic hydration, and client-rendered marketing widgets inserted post-mount can easily destroy your LCP metrics. A statically generated HTML page that loads 2MB of blocking JavaScript and relies on client-side state to render hero layouts will still suffer severe LCP regressions in field data.
What to do this week
To systematically address LCP regressions in your Next.js application, complete these tasks:
- [ ] Audit top traffic templates in PageSpeed Insights to record baseline field and lab LCP values.
- [ ] Inspect hero image declarations across all key page templates and append
priorityprops to above-the-fold assets. - [ ] Profile server-side data fetching calls inside
getServerSidePropsand rewrite serialawaitcalls to execute concurrently usingPromise.all. - [ ] Replace external web font link tags with
next/fontloaders configured withdisplay: 'swap'. - [ ] Verify that cache control headers on static assets and edge network routing correctly serve cached HTML to cut global TTFB to under 200ms.
Tracking Core Web Vitals alongside crawler activity and indexing shifts across large Next.js deployments requires constant monitoring. AutoSEO Stack helps you monitor technical site health and search performance metrics automatically as you deploy platform updates.
Frequently asked questions
Why did my Largest Contentful Paint get worse after moving to Next.js?
Next.js adds client-side JavaScript execution overhead and hydration steps that do not exist in static HTML or traditional monoliths. If your hero image lacks the priority attribute, or if your server-side rendering logic has a high Time to First Byte (TTFB) due to un-cached API calls, the browser cannot render the main element quickly. Fixing LCP regressions after migrating to Next.js usually requires optimizing render-blocking resources, preloading hero elements, and caching SSR responses at the edge.
How do I fix LCP on next/image components?
Add the priority attribute to your hero image component to tell Next.js to inject a preload link tag in the HTML document head. Without this attribute, Next.js lazy-loads images by default, delaying their discovery until after the client JavaScript bundle executes and parses the DOM. Additionally, specify explicit width and height props or use fill with sizes to prevent layout shifts and ensure the browser requests the correctly sized image src for the user viewport.
Does server-side rendering (SSR) improve or hurt LCP?
SSR can hurt LCP if your server logic takes hundreds of milliseconds to assemble the HTML document before returning a response. While SSR helps search engines parse full HTML, a slow database query inside your data fetching functions stalls the initial document byte. SSR only improves LCP when combined with aggressive caching headers, edge network rendering, or incremental static regeneration so the initial document reaches the browser in under 200 milliseconds.
How does font loading impact Next.js LCP performance?
Custom web fonts block text rendering or cause layout shifts that delay the LCP candidate element if the hero content is text-based. Using next/font automatically inlines font CSS and preloads font files at build time, eliminating external render-blocking network requests to third-party hosts like Google Fonts. If fonts are improperly swapped, the browser waits for the network payload before rendering the largest text block, severely inflating your LCP timing.
What is the difference between TTFB and LCP in a Next.js app?
TTFB measures the time between the request and the arrival of the first byte of HTML from your server, while LCP measures when the largest visual element renders on screen. In Next.js, TTFB acts as the baseline floor for LCP; your LCP can never be faster than your TTFB. If your Next.js server takes 1.2 seconds to compute the page, your LCP will automatically exceed good thresholds regardless of how optimized your frontend CSS and images are.
Should I use static generation (SSG) or SSR for better Core Web Vitals?
Static Site Generation (SSG) or Incremental Static Regeneration (ISR) almost always delivers superior Core Web Vitals compared to pure SSR. Static pages are served directly from a global CDN cache, yielding fast TTFB baseline figures across geographical regions. SSR should only be reserved for user-specific dynamic data, and even then, public components should be deferred or cached using stale-while-revalidate strategies on your CDN layer.
Frequently asked questions
how to track ai answer visibility?
Track impressions, citations, and ranking shifts for your AI-generated content.
how to monitor ai answer visibility?
Use tools like AutoSEO Stack to log citations and visibility trends automatically.
can ai detect website traffic?
No, AI models don’t detect traffic; they use public signals and citations to generate answers.
how to improve ai visibility?
Create clear, citation-friendly content that directly answers user questions.
how to track ai answers?
Monitor how often your content is referenced in AI-generated responses across platforms.
Frequently asked questions
How do I track AI answer visibility for my brand?
Set up a weekly scan using a dedicated visibility tool, then compare appearance rates month-over-month rather than chasing absolute numbers.
What's a good AI visibility benchmark?
Most B2B SaaS brands sit between 8-15% appearance rate in their primary categories; e-commerce typically sees 3-8% depending on product specificity.
Can AI visibility tracking predict traffic changes?
Yes—watch for appearance rate shifts of 3% or more combined with ranking position changes; that combination usually precedes a traffic shift within 30 days.
Should I optimize content specifically for AI answers?
Focus on answering user questions directly in the first 100 words of each page; AI models prioritize clear, concise answers over keyword-stuffed content.
Frequently asked questions
how do i know if my brand appears in AI answers?
run a simple prompt search for your brand name across ChatGPT, Perplexity, and Gemini; if you don't see yourself in the top 3 citations, you're invisible
can i track AI answer visibility in google search console?
no; GSC only tracks traditional web search, not LLM citations; you need a dedicated tool or manual prompt logging
what's a good visibility score for a new product?
most teams we see start between 2% and 8% across the big three engines; anything above 10% is already ahead of the curve
how often should i check AI answer visibility?
weekly is the minimum; anything less and you're flying blind as the models update daily