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
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.
<!-- 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: swapor 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.
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.
Related reading
- How to reduce First Contentful Paint (FCP): Reduce First Contentful Paint: lower TTFB, remove render-blocking CSS and scripts, load fonts sensibly and measure improvements with real-user data.
- What is FCP (First Contentful Paint)?: First Contentful Paint explained: what FCP measures, the 1.8 second threshold, how it differs from LCP and TTFB, and the render-blocking fixes that improve it.
- Kubernetes ImagePullBackOff: causes and how to fix it: Fix ImagePullBackOff and ErrImagePull in Kubernetes: wrong tags, private registry credentials, rate limits and network problems, with kubectl commands.
- What is log optimization?: Log optimization explained: finding the noisiest log sources, levels and sampling, structured fields, dropping duplicates, retention tiers.
- ERR_ADDRESS_UNREACHABLE: how to fix it: Fix ERR_ADDRESS_UNREACHABLE: no route to the server, wrong IP in DNS, IPv6 problems, private addresses and firewalls, for visitors and server owners.
- ERR_INTERNET_DISCONNECTED: how to fix it: Fix ERR_INTERNET_DISCONNECTED in Chrome: reconnect Wi-Fi, check the router, disable proxies and VPNs, reset network settings, and when apps say offline.
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.