SiteTidy
HomeGuidesCore Web Vitals (Part 2): Fix Largest Contentful Paint at the Right Layer
Performance

Core Web Vitals (Part 2): Fix Largest Contentful Paint at the Right Layer

A practical LCP optimisation guide covering TTFB, resource discovery, preload and fetchpriority, responsive hero images, render delay, fonts, SSR and the mistakes that make LCP worse.

Published on August 15, 2026Updated August 31, 2026
Core Web Vitals (Part 2): Fix Largest Contentful Paint at the Right Layer

When Largest Contentful Paint is slow, “compress the hero image” is the web-performance equivalent of “have you tried turning it off and on again?”

Sometimes it is exactly the right fix. Often it is not.

LCP is the end of a chain. The browser has to receive enough HTML, discover the important resource, download what it needs, construct the page and finally paint the element. If you optimise the wrong link in that chain, you can spend hours shaving 30 KB from an image while leaving a two-second delay untouched.

A good LCP investigation therefore starts by asking where the time went.

The target for a good LCP remains 2.5 seconds or less at the 75th percentile.

Think of LCP as four broad phases

For an image-based LCP, it is useful to reason about:

  1. Time to First Byte (TTFB) — how long before the initial document begins arriving;
  2. resource load delay — how long after TTFB before the browser starts fetching the LCP resource;
  3. resource load duration — how long that resource takes to transfer;
  4. element render delay — how long after the resource is available before it is actually painted.

The exact diagnostic tooling can present this in more detail, but this model immediately stops you treating every LCP problem as an image-size problem.

Suppose LCP is 4.2 seconds:

  • TTFB: 600 ms;
  • image not requested until 2.4 s;
  • image downloads in 350 ms;
  • image paints at 4.2 s.

Turning a 180 KB image into a 120 KB image is not going to rescue that page. Discovery and render delay are the dominant problems.

First: identify the actual LCP element

Do not guess.

Use Chrome DevTools, PageSpeed Insights/Lighthouse diagnostics and RUM attribution where available to identify the element.

Common LCP candidates include:

  • hero <img> elements;
  • CSS background imagery;
  • video poster images;
  • large headings or text blocks;
  • large content images inside article/product templates.

Also remember that the candidate can change across viewport sizes and page states. Desktop may have a wide hero image while mobile’s LCP is the headline.

This is another reason one synthetic desktop test is not enough.

TTFB: the clock starts before your hero image exists

If the document arrives slowly, everything downstream starts late.

TTFB can be affected by:

  • geographic distance;
  • DNS and connection setup;
  • CDN configuration;
  • cache misses;
  • server-side rendering time;
  • database/API dependencies;
  • middleware and authentication;
  • overloaded infrastructure;
  • redirect chains.

A slow TTFB does not automatically mean “buy a bigger server”.

A dynamic page that spends 900 ms waiting for three sequential API calls may need application architecture work. A static article served from an edge cache should have a completely different profile.

Remove avoidable redirects

If the user requests:

http://example.com

and gets bounced through several hostname/protocol/path redirects before reaching the real document, you are paying latency before useful HTML is even requested.

Canonicalise cleanly.

Cache HTML where the product allows it

Public marketing and editorial content often has far more caching opportunity than teams use.

Authenticated dashboards are different. Do not copy a static-site caching recipe onto personalised pages without understanding privacy and correctness.

Stream or render useful HTML early

If your framework can deliver the shell and LCP-relevant markup without waiting for unrelated below-the-fold data, take advantage of that architecture.

The LCP resource cannot be discovered from HTML the browser has not received.

Resource discovery is often the hidden LCP killer

The ideal LCP image is discoverable directly from the initial HTML.

This is good:

<img
  src="/images/hero-1280.avif"
  width="1280"
  height="720"
  alt="Dashboard showing a completed site audit"
>

The preload scanner can see it while the browser is still parsing the document.

This is much less helpful:

<div id="hero"></div>
<script src="/app.js"></script>

where app.js must download, parse and execute before a component decides which image URL to inject.

The image may be tiny and still start far too late.

Do not lazy-load your LCP image

This deserves its own heading because it remains such a common self-inflicted problem.

Above-the-fold LCP images generally should not use:

loading="lazy"

Lazy loading is excellent for images the user may never scroll to. It is the wrong optimisation for the most important image currently visible on the page.

If your framework or CMS adds lazy loading automatically, explicitly opt the hero/LCP image out.

fetchpriority="high" is useful — when the resource really is important

For an important image discovered in HTML, you can give the browser an additional priority hint:

<img
  src="/images/hero.avif"
  width="1280"
  height="720"
  fetchpriority="high"
  alt="SiteTidy audit results"
>

This can be especially useful because images do not necessarily begin at the highest fetch priority even when they are visually important.

But fetchpriority="high" is not a magic speed attribute.

If you mark six carousel images, three logos and every product thumbnail high priority, you have not made the network faster. You have made your prioritisation less meaningful and may cause resources to compete with each other.

Reserve it for resources that genuinely deserve to move forward in the queue.

When to preload the LCP image

Preload is useful when the browser would otherwise discover an important resource late — for example, an image referenced from CSS or selected by JavaScript.

<link
  rel="preload"
  as="image"
  href="/images/hero.avif"
  fetchpriority="high"
>

But do not turn your <head> into a list of speculative preloads.

Every preload consumes bandwidth and priority. Preloading resources that are not needed promptly can hurt the resources that are.

For responsive images, make sure the preload strategy matches the image the browser will actually use rather than downloading one candidate and then fetching another.

Responsive images: stop sending desktop pixels to mobile

A 2400-pixel hero displayed at 390 CSS pixels is usually wasteful.

Use srcset and sizes so the browser can choose an appropriate candidate:

<img
  src="/images/hero-1280.avif"
  srcset="
    /images/hero-640.avif 640w,
    /images/hero-960.avif 960w,
    /images/hero-1280.avif 1280w,
    /images/hero-1920.avif 1920w
  "
  sizes="100vw"
  width="1920"
  height="1080"
  fetchpriority="high"
  alt="Site audit dashboard"
>

The sizes value matters. A misleading sizes="100vw" on an image that only occupies half the viewport can cause the browser to select a larger candidate than necessary.

Model the actual layout.

AVIF and WebP help, but format is not the whole job

Modern formats can materially reduce transfer size, especially for photographic imagery.

However, the best image format depends on the asset and your encoding settings. Logos and simple illustrations may be better as SVG. Some images compress surprisingly well as WebP; others benefit significantly from AVIF.

Do not optimise by file extension.

Compare:

  • visual quality;
  • encoded size;
  • decode cost where relevant;
  • browser support requirements;
  • operational complexity.

And do not serve a 1.5 MB AVIF and call it optimised because it is AVIF.

CSS background images are harder to discover

A hero defined like this:

.hero {
  background-image: url('/images/hero.avif');
}

cannot be requested until the browser has obtained enough CSS to discover the URL.

That may be perfectly acceptable for decorative imagery. If the image is your LCP element, however, the dependency chain deserves scrutiny.

Options include:

  • making the meaningful image an actual <img>/<picture> element;
  • preloading it carefully;
  • ensuring the relevant CSS is available immediately.

Use semantic HTML when the image is content. It often makes both accessibility and loading behaviour easier.

The image can be loaded and LCP can still be slow

This is the part many optimisation guides skip.

If the LCP resource finishes downloading at 1.4 seconds but LCP occurs at 3.6 seconds, resource size is not the main remaining problem.

You have render delay.

Potential causes include:

  • the element is hidden until JavaScript runs;
  • client-side rendering delays insertion;
  • a large script monopolises the main thread;
  • CSS required to render the element arrives late;
  • an entrance animation keeps the content invisible;
  • the page waits for hydration before exposing content;
  • fonts delay the text candidate.

The cure is architectural, not another image compressor.

Beware the fashionable fade-in

This pattern looks harmless:

.hero {
  opacity: 0;
  animation: reveal 600ms ease 1s forwards;
}

You have deliberately told the browser not to show the hero immediately.

If that element matters to LCP, your decorative reveal can become measurable user-facing delay.

Animation should enhance content that is available, not routinely hold important content hostage.

Client-side rendering can create unnecessary LCP delay

Imagine an article page whose title and hero image are already known at request time, but the server sends:

<div id="app"></div>

The browser then downloads a JavaScript bundle, executes the framework, fetches article data and finally renders the hero.

That architecture creates a dependency chain before meaningful content can exist.

For content-heavy routes, server rendering, static generation or otherwise putting useful HTML in the initial response can dramatically improve resource discovery and render timing.

This does not mean “SSR is always faster”. A badly implemented SSR system with a huge TTFB can simply move the bottleneck.

Measure the whole path.

Fonts and text LCP

If the LCP candidate is text, web-font behaviour can matter.

A large heading rendered in a custom font may be delayed or repainted depending on font loading strategy.

Useful tactics include:

  • subset fonts;
  • use WOFF2;
  • self-host where that improves your delivery/control model;
  • preload genuinely critical fonts;
  • avoid preloading every weight and style;
  • choose an appropriate font-display strategy;
  • use a fallback font with compatible metrics to reduce layout movement.

Part 7 covers font and rendering-path optimisation in depth.

Third-party code can delay LCP without touching the image

Tag managers, consent platforms, A/B testing systems and advertising scripts can occupy the main thread or alter the DOM during startup.

If a third party executes before your hero paints, inspect it as part of the LCP path.

“It comes from a vendor” is an ownership detail, not a performance exemption.

Ask:

  • does it need to run before first paint?
  • can it load after the important content?
  • can the integration be simplified?
  • is it doing synchronous work?
  • does it inject render-blocking resources?

A practical LCP debugging sequence

When a page fails LCP, work through this order.

1. Identify the LCP element

Check real-user attribution and reproduce it in DevTools.

2. Look at TTFB

If the document starts late, investigate redirects, CDN/cache behaviour and backend rendering before obsessing over frontend bytes.

3. Find when the LCP resource is discovered

If the image request begins late, ask why.

Is it in initial HTML? CSS? JavaScript? A client-side API response?

4. Inspect transfer duration

Now image size, format, dimensions, CDN and connection quality become relevant.

5. Compare resource completion with paint time

A large gap means render delay.

Inspect main-thread work, CSS, visibility, hydration and animation.

6. Re-test under realistic constraints

A fix that saves 40 ms on a desktop workstation may matter much more — or not at all — on a mid-range phone.

7. Verify in field data

Synthetic improvement is evidence that the change works under the test. RUM tells you whether it helped the population you care about.

An example: fixing the wrong thing first

Suppose a product page has a 4.0-second mobile LCP.

The hero image is 260 KB, so the team spends a day reducing it to 150 KB. LCP becomes 3.8 seconds.

A trace then reveals:

  • document begins at 500 ms;
  • app bundle finishes at 1.7 s;
  • product API returns at 2.2 s;
  • React inserts the hero <img> at 2.3 s;
  • image finishes at 2.65 s;
  • long JavaScript task blocks rendering until 3.8 s.

The image was not irrelevant. It simply was not the dominant problem.

A better architecture might render the product heading and hero URL into the initial HTML, allow immediate image discovery, and defer non-critical JavaScript. That can remove entire phases of delay rather than shaving milliseconds from one transfer.

What not to do

Do not preload every image

Preload is prioritisation, not free bandwidth.

Do not set every image to high priority

If everything is high priority, you have failed to prioritise.

Do not lazy-load the visible hero

Use lazy loading below the fold.

Do not remove width and height to make responsive CSS “easier”

HTML dimensions establish an aspect ratio and help layout stability. CSS can still make the image fluid.

Do not assume a CDN fixes discovery

A CDN can make a late request faster once it exists. It cannot make JavaScript discover the URL earlier.

Do not sacrifice image quality blindly

Performance is part of user experience, not the only part. Use perceptually sensible encoding.

The LCP question worth remembering

Was the element slow because the server started late, the browser discovered it late, the resource downloaded slowly, or the browser could not paint it promptly? Answer that before choosing the fix.

Inspect your site with SiteTidy →

Production checklist

For likely LCP elements:

  • make important content available in initial HTML where practical;
  • keep TTFB under control;
  • avoid unnecessary redirects;
  • do not lazy-load above-the-fold LCP images;
  • use responsive image candidates;
  • use modern formats where they are actually beneficial;
  • set intrinsic dimensions;
  • consider fetchpriority="high" for the genuine LCP image;
  • preload only when it fixes a real discovery problem;
  • minimise render-blocking CSS and startup JavaScript;
  • do not hide meaningful content behind decorative animations;
  • investigate render delay after resource completion;
  • measure on representative mobile hardware/conditions;
  • verify improvement in RUM rather than stopping at Lighthouse.

A fast LCP is rarely produced by one clever attribute. It comes from making the critical content path short, obvious and difficult to accidentally block.

Part 3 moves from loading to responsiveness: how to diagnose and fix poor INP without simply deleting every useful interaction from the page.

Ready to audit your site?

Put this guide into practice immediately using our free tools.

Browse 180+ Free Tools