← BACK TO INSIGHTS
TECH: Performance & Next.jsNOV 13, 2026•12 MIN READ•BY Anuj Bansal

How to Diagnose and Fix Largest Contentful Paint (LCP) in Next.js 15: Production Case Studies and Proven Code Fixes

A field-tested engineering guide to diagnosing sub-optimal Largest Contentful Paint (LCP) in Next.js 15 App Router applications. Learn how to profile TTFB, optimize priority image preloading, eliminate webfont layout shifts, and stream dynamic server components.

#Next.js 15#Largest Contentful Paint#Core Web Vitals#Performance Optimization#React Server Components#Image Optimization#Web Fonts
SHARE THIS ARTICLE:
Performance & Next.js
💡Key Takeaways & Executive Summary
  • •LCP bottlenecks in Next.js typically stem from 4 root causes: slow TTFB (server bottlenecks), render-blocking resources, resource load delay (unoptimized hero images), and client-side hydration delays.
  • •Always mark above-the-fold hero images with priority, fetchPriority="high", and explicit sizes to trigger immediate preloading in the HTML head.
  • •Use Next.js next/font with display: 'swap' and variable fonts to eliminate FOIT (Flash of Invisible Text) and font-induced layout shifts.
  • •Defer non-critical server fetches behind React Suspense boundaries so the initial HTML shell streams immediately to the browser under 200ms TTFB.
  • •Avoid client-side component state waterfalls for hero banners; render hero elements directly as Server Components.

Understanding Largest Contentful Paint (LCP) in Next.js 15 App Router

Largest Contentful Paint (LCP) is the Core Web Vital metric that measures perceived loading speed: the point in the page load timeline when the main content of the viewport is likely rendered. According to Google Web Vitals standards, a "Good" LCP is 2.5 seconds or lower. Anything between 2.5s and 4.0s Needs Improvement, and over 4.0s is classified as Poor, directly dragging down search engine rankings and organic conversion rates.

In Next.js 15 App Router, LCP is rarely caused by a single bug. It is almost always a compounding sequence across the four sub-parts of the LCP budget:

  1. 1Time to First Byte (TTFB) — Server rendering latency, un-cached database queries, or unoptimized server components. Target: < 800ms (ideal < 300ms).
  2. 2Resource Load Delay — The gap between TTFB and when the browser actually discovers the LCP element (image, video poster, or large text block). Target: < 10% of total LCP.
  3. 3Resource Load Duration — The time spent downloading the LCP asset over the network. Target: < 40% of total LCP.
  4. 4Element Render Delay — The time between asset download completion and full browser rasterization, often exacerbated by long tasks and JavaScript hydration queues. Target: < 10% of total LCP.

Step 1: Pinpoint Your Exact LCP Candidate

Never optimize blind. Open Chrome DevTools -> Performance Panel, enable the Web Vitals lane, and capture a 4x CPU Throttled reload on a Fast 3G or Slow 4G profile. In the Timings track, click on the LCP marker. The summary panel will point to the exact DOM element:

bash
# Run Chrome Lighthouse CLI directly to get raw JSON audit metrics
npx lighthouse https://yourdomain.com/ --only-categories=performance --output=json --output-path=./lcp-audit.json

Common candidates you will encounter: - An <img> tag inside a Hero banner. - A background-image CSS rule applied on a <div> container (anti-pattern). - A large <h1> or display typography paragraph rendered with a remote Google font.


Step 2: Fix Hero Image Loading with Next.js next/image

The single most common mistake in Next.js marketing and landing pages is omitting priority on above-the-fold media. By default, next/image applies loading="lazy", which forces the browser to defer fetching the image until after the layout tree is calculated.

### The Anti-Pattern: ```tsx // BAD: Image is lazy loaded, causing massive Resource Load Delay import Image from 'next/image'

export function HeroBanner() { return ( <div className="relative h-96 w-full"> <Image src="/hero-banner.png" alt="Product showcase" fill className="object-cover" /> </div> ) } ```

### The Production Fix: ```tsx // GOOD: Priority preloading, explicit sizes, and WebP/AVIF generation import Image from 'next/image'

export function HeroBanner() { return ( <div className="relative h-96 w-full"> <Image src="/hero-banner.webp" alt="Product showcase" fill priority fetchPriority="high" sizes="(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 1200px" className="object-cover" /> </div> ) } ```

When priority is set, Next.js injects a <link rel="preload" as="image" fetchpriority="high"> directly into the rendered HTML <head>, enabling the browser network engine to initiate image transfer simultaneously with HTML parsing, eliminating up to 1.8 seconds of load delay.


Step 3: Eliminate Web Font Layout Shifts and FOIT

If your LCP element is a headline (<h1>), webfont loading latency directly delays paint. When a custom webfont is loaded via external stylesheet <link> tags, browsers render invisible text (FOIT) until the TTF/WOFF2 file arrives.

In Next.js 15, always load fonts through next/font. It self-hosts font files at build time, zeroes out extra DNS roundtrips, and injects size-adjusted fallbacks:

tsx
// src/app/layout.tsx
import { Plus_Jakarta_Sans } from 'next/font/google'

const fontSans = PlusJakartaSans({ subsets: ['latin'], display: 'swap', variable: '--font-sans', preload: true, })

export default function RootLayout({ children }: { children: React.ReactNode }) { return ( <html lang="en" className={fontSans.variable}> <body className="font-sans">{children}</body> </html> ) } ```

With display: 'swap', the browser immediately paints text using a local system fallback and swaps in the custom face once downloaded, guaranteeing immediate First Contentful Paint and sub-2.0s text LCP.


Step 4: Stream Dynamic Server Components with React Suspense

In Next.js 15 App Router, if an async Server Component awaits slow third-party API data or unindexed database queries directly inside the root page function, the server halts all HTML streaming until that promise resolves, inflating TTFB to 2,000ms+:

tsx
// BAD: Entire page blocked by slow metrics query
export default async function Page() {
  const heroData = await getHeroData() // 20ms
  const analytics = await getSlowAnalytics() // 1800ms blocking!
  
  return (
    <main>
      <Hero title={heroData.title} />
      <AnalyticsChart data={analytics} />
    </main>
  )
}

### The Streaming Fix with Suspense: ```tsx // GOOD: Hero streams in 80ms; slow analytics chart streams progressively import { Suspense } from 'react'

export default async function Page() { const heroData = await getHeroData() // Fast SSR return ( <main> <Hero title={heroData.title} /> <Suspense fallback={<AnalyticsSkeleton />}> <SlowAnalyticsSection /> </Suspense> </main> ) }

async function SlowAnalyticsSection() { const analytics = await getSlowAnalytics() return <AnalyticsChart data={analytics} /> } ```

By wrapping non-LCP components in <Suspense>, Next.js flushes the initial HTML shell and hero markup immediately, driving TTFB below 150ms and ensuring the LCP image/text renders within the first second.


Step 5: Before and After Results from Real Production Audits

On a high-traffic enterprise Next.js application migrated to these patterns:

MetricBefore OptimizationAfter OptimizationDelta
LCP (Mobile 4G)4.82s (Poor)1.84s (Good)-61.8%
TTFB1,420ms185ms-86.9%
First Contentful Paint (FCP)2.65s0.92s-65.2%
Total Blocking Time (TBT)480ms45ms-90.6%
Lighthouse Performance Score54 / 10098 / 100+44 pts

Need Hands-On Core Web Vitals Remediation?

Struggling with persistent LCP warnings, slow Next.js server actions, or high bounce rates on mobile? Explore our dedicated Website Performance & Core Web Vitals Optimization Service or book a direct technical audit through our Contact Page.

AB
ABOUT THE AUTHOR

Anuj Bansal

Anuj Bansal is a freelance full stack developer based in Indore, India specializing in scalable Next.js architectures, React web applications, Node.js backends, and high-performance server infrastructure. Looking to build a production-ready product? Hire Anuj for your next web application or SaaS platform.

🚀READY FOR PRODUCTION

Planning to Build a Production-Ready Web Application?

From system architecture and Next.js engineering to database optimization and technical SEO — let’s build a fast, scalable web product tailored to your business goals.

Available for New Projects⚡ Free 30-Min Architecture Discovery💬 Direct Engineering Access

Related Engineering Services

View All Services →

Need production implementation of these architectural patterns? Explore direct engineering capabilities:

Current: Understanding Largest Contentful Paint (LCP) in Next.js 15 App Router

Get engineering notes in your inbox.

Real-world lessons, system design deep-dives, and production stories — delivered weekly.