Under The Hood
frontend browser W3C Performance Timeline / Core Web Vitals 2026

Largest Contentful Paint (LCP) & Cumulative Layout Shift (CLS) Sub-Metrics

Last updated
Prerequisites:
Critical rendering path
Browser layout engine fundamentals
  • browser
  • web-vitals
  • lcp
  • cls
  • performance
  • layout-shift

Read at your depth

The practical view

Largest Contentful Paint (LCP) tracks perceived load speed by measuring when the largest visible text block or image finishes rendering in the viewport (target <= 2.5s). Cumulative Layout Shift (CLS) measures visual stability by tracking unexpected element movements during the page lifecycle (target <= 0.1). LCP breaks down into Time to First Byte (TTFB), Resource Load Delay, Resource Load Duration, and Element Render Delay.

The same idea in other frameworks

react equivalent
`next/image` with `priority` for LCP; fixed aspect-ratio wrappers to eliminate CLS.

Legacy vs modern

Lazy LCP Image & Unbounded Ad vs Preloaded LCP & Reserved Space

Late-discovered lazy images hurt LCP and unreserved dynamic banners cause CLS; preloading and aspect-ratio reservation solve both.

before → after
Lazy Hero + Dynamic Insert
<img src="hero.jpg" loading="lazy" /> <!-- ❌ LCP delayed + CLS on inject -->
Optimized LCP + Reserved Layout Box
<link rel="preload" fetchpriority="high" ... /> <div style="min-height: 250px">...</div> <!-- ✅ NEW -->

Interview gotchas

Context

Tests deep diagnostic knowledge of the Core Web Vitals breakdown.

The mechanical answer

The four sub-parts are: (1) TTFB (time until HTML arrives), (2) Resource Load Delay (time between HTML arriving and the browser initiating the image fetch), (3) Resource Load Duration (time to download image bytes), and (4) Element Render Delay (time from image download until it is painted). Resource Load Delay is often the easiest win: fixing it means eliminating client-side CSS/JS discovery chains via HTML `<link rel='preload'>` or `fetchpriority='high'` directly in initial HTML.

Trap

Never put `loading='lazy'` on an above-the-fold hero image; it introduces massive Resource Load Delay because the browser defers the fetch until after layout completes.

Under The Hood — a multi-depth technical interview hub.

Third-party licenses Press ⌘ K to search.