Early accessCodeGecko is opening to a first group of teams.Join the waitlist

How to improve LCP: find the slow part, then fix it

LCP is four steps in a row, and usually only one of them is slow. Here’s how to split Largest Contentful Paint into its parts, find the slow one, and apply the fixes that belong to it.

Nour9 min read ·
LCP in four parts

Find the slow one first.

Your LCP is slow. PageSpeed Insights says so, Search Console says so, and the advice online is a list of twenty things to try: compress images, add a CDN, preload fonts, remove unused CSS, upgrade your hosting. You try a few. The number barely moves.

That’s because LCP isn’t one number. It’s four steps in a row, and only one or two of them are usually slow on your page. Fix the wrong step and nothing happens. Here’s how to split LCP into its parts, find the slow one, and apply the fixes that belong to it.

The short answer

Largest Contentful Paint should be 2.5 seconds or less for three out of four real visits, the 75th percentile. To get there, split it into four parts: the server answering, the wait before the main image starts loading, the image downloading, and the wait before it’s drawn. Measure all four on real visits, find the biggest one, and fix that first.

Most slow LCPs aren’t a slow server or a heavy image. They’re an image the browser found too late.

What LCP measures

LCP is the moment the biggest thing in the first screen appears. On most pages that’s a hero image, a product photo or a large heading. The browser keeps updating its pick while the page loads, and stops at the first click, tap or scroll.

That has two consequences. First, the LCP element can differ between phones and desktops, because a different thing is biggest on a narrow screen. Second, it can differ between visitors, for example when a cookie banner is the biggest thing for new visitors only. So before fixing anything, find out what the LCP element actually is for most of your visits.

The four parts of LCP

Every LCP can be split into four steps that happen one after the other. Google’s own guidance uses the same split, and Chrome’s Performance panel shows it too.

  1. 01Server response (TTFB). From the click until the first byte of HTML arrives: redirects, connection setup and your server building the page.
  2. 02Load delay. From the first byte until the browser starts downloading the LCP image. This is time where the browser could be loading it, but doesn’t know about it yet.
  3. 03Image load. How long the image itself takes to download. Size, format and how close the server is decide this one.
  4. 04Render delay. From the image arriving until it’s actually on screen. Blocking CSS, fonts, JavaScript and hidden content all live here.

When the LCP element is text, there’s no image, so load delay and image load are zero and everything after the server response is render delay.

As a rough guide, a healthy page spends most of its LCP on the server response and the image download, the two parts that do real work. Load delay and render delay are waiting, and on a well-built page they’re small. When either of them is big, that’s usually the easiest win you have.

Find the slow part

  1. 01Name the LCP element. Run PageSpeed Insights on the page and open the Largest Contentful Paint element in the diagnostics. It shows the element and the time spent in each part. Check Mobile first, since that’s the one that usually fails.
  2. 02Look at it in Chrome. Open DevTools, go to the Performance panel and record a page load with network and CPU slowed down. The LCP marker shows the same four parts, and you can see what the browser was busy with during each one.
  3. 03Check it on real visits. One lab run uses one device, one network and an empty cache. Your visitors have all sorts. The part that’s slow in the lab isn’t always the part that’s slow for them, so confirm it with field data before you spend a week on it.

If the server is slow

A slow server response delays everything after it, so it’s worth fixing even when it isn’t the biggest part. A good TTFB is under about 800 milliseconds.

  • Cache the HTML. If a page is the same for everyone, serve it from a CDN or the edge instead of building it on every request.
  • Remove redirects. http to https, bare domain to www, and a trailing slash can each add a full round trip. Link straight to the final URL.
  • Find the slow step on the server. Add a Server-Timing header to your HTML, for example Server-Timing: db;dur=120, render;dur=60. Many frameworks and hosts can send one already. It tells you whether the time goes to the database, an API call or rendering.

If the image starts late

This is the most common culprit and the cheapest to fix. The browser can only start loading an image once it knows about it, and many pages hide it:

  • Put the image in the HTML. A plain img tag is found as soon as the HTML arrives. A CSS background is only found once the CSS is loaded, and an image added by JavaScript only once that script has run.
  • Never lazy-load it. loading="lazy" on the hero image tells the browser to wait. It’s often added to every image by a component or plugin, so check the one at the top.
  • Give it fetchpriority="high". It moves the image ahead of other images and scripts in the queue.
  • Preload it when you can’t do the above. If the image has to stay a background or come from a script, a preload link in the head lets the browser start early anyway.
  • Serve it from your own domain. An image on another domain needs a new connection first. If it must live elsewhere, add a preconnect for that domain.

If the image downloads slowly

  • Send the right size. A 2400px photo on a 400px phone screen is mostly wasted. Use srcset and sizes so phones get a small file.
  • Use a modern format. AVIF or WebP are usually a fraction of the size of a JPEG or PNG at the same quality.
  • Serve it from a CDN. Distance matters, especially on phones. An image served from a city near the visitor arrives sooner.
  • Don’t let other files compete. Big scripts, fonts and other images loaded at the same time share the same bandwidth. Load what isn’t needed for the first screen later.

If it loads but isn’t shown

A big render delay means the image, or the text, was ready but something stopped the browser from drawing it.

  • Blocking CSS and scripts. Stylesheets and scripts in the head without async or defer hold up the first paint. Keep the CSS needed for the first screen small and defer the rest.
  • Web fonts on a text LCP. If the heading waits for its font, LCP waits too. Use font-display: swap and preload the one font the heading uses.
  • Content rendered by JavaScript. If the page arrives empty and a framework fills it in, LCP waits for the whole app to download and start. Render the first screen on the server.
  • Hidden until a script says so. A/B testing tools and fade-in animations often hide content until they’re ready. That time counts as render delay. We cover the cost of tags like these in How much do third-party scripts slow down your site?

Check the fix on real visits

Lab tests are good for finding the slow part, but they can’t tell you whether your fix helped the people who were having the slow visits. And waiting for Google to notice takes about four weeks, as we explain in Core Web Vitals assessment failed? What it means and how to fix it.

Real visits also show something a lab can’t: who it’s slow for. If LCP is only slow on slow mobile networks, the image download is the problem and smaller files will help. If it’s slow on fast connections too, the problem is the order things load in: load delay or render delay. And if it’s slow in one browser only, look at features that browser handles differently, like image formats or preloads.

That’s what CodeGecko does. It collects LCP from real visits, names the element that was the LCP on each one, and can split it into load delay, image load and render delay next to the server response. It reads your Server-Timing header if you send one, and shows LCP by browser and network speed in a Who saw it table. Then it compares each release with the one before it, page by page and per device, so you know the day you ship whether your fix worked. The docs list everything we measure, and the demo shows a release that regressed.

  • Find out what the LCP element is for most visits, on phones first.
  • Split LCP into server response, load delay, image load and render delay.
  • Fix the biggest part first, using the fixes for that part.
  • Ship it, and compare the release with the one before it on real visits.
  • Keep measuring, so the next slow image is caught the day it ships.

Common questions

What is a good LCP? 2.5 seconds or less at the 75th percentile is good. Over 4 seconds is poor. Anything in between needs improvement.

Does preloading the LCP image always help? Only when load delay is the slow part. If the image is already in the HTML and starts loading right away, a preload changes nothing, and preloading too many files makes everything slower.

Why is my LCP worse on phones? Slower processors, slower networks and often a different LCP element. Measure phones and desktops separately and fix phones first.

Why did my LCP get worse when I didn’t touch the images? Any change before the image can push it back: a new script in the head, a bigger stylesheet, a slower API call on the server, or a tag that hides content until it loads. Splitting LCP into its parts shows which step got longer.

My LCP element is text. What do I fix? Server response and render delay, since there’s no image to load. Render the text in the HTML, keep blocking CSS small, and make sure the heading isn’t waiting for a font.

NourBuilding CodeGecko

Senior frontend engineer, night-shift gamer, weekend photographer, and the human who taught a gecko to watch your deploys.

Get in early.

We’re letting teams in a few at a time. Join the waitlist and we’ll email you once, when your spot opens.

Go deeper

Keep reading