Skip to content
Painter
Performance

Why your LCP element is not what you think

Teams optimise the hero image for a fortnight and discover the LCP element was a paragraph of text the whole time.

The largest contentful paint element is whatever is largest in the viewport when the page settles, and on a text-heavy page that is very often a heading or a block of copy, not an image.

Check before you optimise. The browser will tell you outright, and the answer takes ten seconds to get.

new PerformanceObserver((list) => {
  const entry = list.getEntries().at(-1);
  console.log(entry.element, entry.startTime);
}).observe({ type: 'largest-contentful-paint', buffered: true });

If it turns out to be text, your fix is a font problem, not an image problem.

Leave a comment

Real questions get real answers. The editorial team reads every thread.