Skip to content

Troubleshooting guide

How to improve LCP (Largest Contentful Paint)

LCP is the sum of four parts. Measure which one is largest on your slow pages, then apply the matching fix instead of guessing.

3 min read10 sectionsUpdated

On this page

Key points

  • Identify the LCP element first: usually the hero image or headline.
  • Make it discoverable early: in the HTML, not behind CSS or JavaScript.
  • Make it small: modern formats, the right size, a CDN.
  • Let it render: no lazy-loading, no blocking scripts, no client-only rendering.

Find the LCP element and its timing

Run the page through Chrome devtools (Performance panel) or our free LCP check, which loads it in a real Chrome browser and highlights the element. Note the four sub-parts: TTFB, resource load delay, resource load duration and element render delay. The largest one is your priority.

Fix discovery delay

The browser can only fetch what it has found. Images set as CSS backgrounds, injected by JavaScript sliders, or marked loading="lazy" are found late.

html
<!-- Good: in the HTML, sized, high priority, not lazy -->
<img src="/hero-1200.avif"
     srcset="/hero-800.avif 800w, /hero-1200.avif 1200w, /hero-1600.avif 1600w"
     sizes="(max-width: 800px) 100vw, 1200px"
     width="1200" height="630" alt="Product dashboard"
     fetchpriority="high">

<!-- If it must be a CSS background, preload it -->
<link rel="preload" as="image" href="/hero-1200.avif" fetchpriority="high">

Fix download time

  • Use AVIF or WebP, typically much smaller than JPEG or PNG at similar quality.
  • Serve the displayed size with srcset, not a 4000-pixel original.
  • Serve from a CDN close to visitors, with long cache lifetimes.
  • Do not host the LCP image on a different origin without preconnect; each new origin costs connection setup.

See the image optimisation checklist.

Fix render delay

  • Render-blocking CSS: inline the critical CSS, load the rest asynchronously.
  • Synchronous scripts in the head: add defer.
  • Text LCP waiting on fonts: preload the font and use font-display: swap or optional; see fonts without layout shift.
  • Client-side rendering: server-render the first screen so the content is in the initial HTML.
  • A/B testing or anti-flicker snippets that hide the page until a script runs: remove or limit them.

Fix server time

If TTFB alone is over a second, no front-end change can bring LCP under 2.5 s on slower networks. Start with reducing TTFB.

Verify with field data

Lab improvements do not always show up for real users. Compare the 75th percentile of LCP per page before and after, split by mobile and desktop. VitalRix real user monitoring records LCP for every page view, so you can confirm the change worked for your actual visitors.

Frequently asked questions

Does lazy loading help LCP?

Lazy loading helps images below the fold. On the LCP image it hurts, because the browser delays fetching it. Never lazy-load the hero.

Why is LCP worse on mobile?

Slower CPUs, slower networks and often larger images relative to bandwidth. Test and optimize mobile separately.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.