Core Web Vitals Playbook: LCP, INP and CLS in Practice

A practical playbook for improving LCP, INP and CLS: what each metric measures, the fixes that move the numbers, and how to measure real users instead of trusting a single lab score.

DIDatainter TeamJUL 06, 202510 MIN READTECHNOLOGY

Web performance advice tends to arrive as a long checklist, which is why it often goes unimplemented. A better approach is to anchor the work on the three metrics Google calls Core Web Vitals, understand what each one measures, and fix the specific bottleneck that causes your numbers to be poor. This article is a playbook for doing that: how to read the metrics, the fixes with the highest return, and how to measure real users so you know whether you actually improved anything.

The three metrics and their thresholds

Core Web Vitals are field metrics: they describe what real users experienced, measured at the 75th percentile of page loads. To pass, 75 percent of visits need to land in the “good” range.

Metric Measures Good Needs improvement Poor
Largest Contentful Paint (LCP) Time until the largest visible element renders 2.5 s or less 2.5 to 4 s Over 4 s
Interaction to Next Paint (INP) Latency of interactions across the whole visit 200 ms or less 200 to 500 ms Over 500 ms
Cumulative Layout Shift (CLS) Unexpected movement of visible content 0.1 or less 0.1 to 0.25 Over 0.25

INP replaced First Input Delay as the responsiveness metric in March 2024. FID only measured the delay before the first interaction; INP considers all clicks, taps and key presses during the visit and reports roughly the worst one. That makes it a much tougher test for JavaScript-heavy applications.

These metrics matter for two reasons. They correlate with user behavior: slower pages convert and retain worse, a pattern documented repeatedly in case studies by large retailers and publishers. And they are a ranking signal in Google Search, though a modest one compared with relevance. Treat them primarily as a user-experience investment and secondarily as an SEO one.

Measure first: lab versus field

You need both kinds of data, and you should understand what each is good for.

Field data (real user monitoring) tells you what is true. Sources include the Chrome User Experience Report (CrUX), surfaced in PageSpeed Insights and Search Console, and your own collection using the web-vitals JavaScript library, which reports LCP, INP and CLS from actual sessions. Field data has a long tail: slow phones, poor networks, extensions, and unusual viewport sizes.

Lab data (Lighthouse, WebPageTest, Chrome DevTools) tells you why. It is reproducible, which makes it ideal for debugging and for catching regressions in CI. But it runs on one simulated device and network, and it cannot measure INP without scripted interactions.

A minimal field collection looks like this:

import { onLCP, onINP, onCLS } from "web-vitals/attribution";

function send(metric) {
  const body = JSON.stringify({
    name: metric.name,
    value: metric.value,
    rating: metric.rating,
    id: metric.id,
    page: location.pathname,
    // attribution tells you which element or script was responsible
    target: metric.attribution?.element ?? metric.attribution?.interactionTarget,
  });
  navigator.sendBeacon("/rum", body);
}

onLCP(send); onINP(send); onCLS(send);

Use the attribution build. Knowing that your p75 LCP is 3.4 seconds is not actionable; knowing that the LCP element is a hero image whose request starts 1.8 seconds after navigation is. Segment results by page template, device class and connection type. A single site-wide number hides the fact that your product pages are fine while your checkout is not.

Set a budget and enforce it. Running Lighthouse CI on pull requests with thresholds for bundle size and lab LCP catches most regressions before they reach users.

Technology · Core Web Vitals Playbook: LCP, INP and CLS in Practice

Improving LCP

LCP breaks into four sequential phases, and it helps to find which one is large:

  1. Time to first byte (TTFB): server and network time before the document starts arriving.
  2. Resource load delay: time before the browser starts fetching the LCP resource.
  3. Resource load duration: download time for that resource.
  4. Element render delay: time between resource arrival and painting.

Most poor LCP comes from the second phase: the browser discovers the hero image late. Typical fixes:

  • Make the LCP resource discoverable in the HTML. Do not load it through client-side JavaScript, CSS background images, or lazy-loading libraries. Use a plain <img> with src in the initial markup.
  • Raise its priority. Add fetchpriority="high" to the LCP image, and never apply loading="lazy" to it. Lazy-loading above-the-fold images is one of the most common self-inflicted wounds.
  • Preload when necessary. For images referenced from CSS or injected late, <link rel="preload" as="image" href="..." fetchpriority="high"> helps.
  • Reduce TTFB. Cache HTML at the CDN where possible, use stale-while-revalidate, avoid chained redirects (particularly http to https to www), and keep database queries off the critical path of cacheable pages. A TTFB over 800 ms makes a good LCP nearly impossible.
  • Avoid render-blocking resources. Inline critical CSS or keep stylesheets small; defer non-critical scripts.
  • Don’t hide content behind client rendering. If the LCP element appears only after a JavaScript framework hydrates and fetches data, LCP includes all that time. Server-side rendering or static generation moves the element into the first response.

Images

Images are the LCP element on the majority of pages, and they dominate page weight, so they deserve their own discipline.

  • Use modern formats. AVIF and WebP typically cut file size 30 to 50 percent versus JPEG at equal perceived quality. Serve through <picture> or content negotiation at the CDN, with a JPEG fallback.
  • Serve the right size. Use srcset and sizes so a phone does not download a 2400-pixel-wide desktop image.
  • Set explicit width and height (or CSS aspect-ratio) to reserve space and prevent layout shift.
  • Lazy-load below the fold with loading="lazy", and decoding="async" for non-critical images.
  • Compress deliberately. Quality 75 to 80 is usually indistinguishable for photographs. Strip metadata.
  • Use an image CDN or framework component that handles resizing, format negotiation and caching, so developers do not hand-produce variants.

Fonts

Web fonts affect both LCP (text is often the largest element) and CLS (text reflows when the font swaps).

  • Self-host fonts rather than depending on a third-party font domain; you save a DNS lookup, a connection and a possible blocking request.
  • Use WOFF2 only, and subset to the characters you need. A Latin subset can be 20 to 30 KB instead of 150 KB.
  • Preload the one or two font files used above the fold, with crossorigin.
  • Set font-display: swap or optional. swap shows fallback text immediately, then swaps; optional avoids the swap if the font is late, which is best for CLS.
  • Match fallback font metrics using size-adjust, ascent-override and related descriptors, so the swap barely moves the text. Many frameworks automate this.
  • Prefer variable fonts when you use multiple weights, since one file replaces several.

Improving INP

INP is a property of how long the main thread is busy when the user interacts. An interaction has three parts: input delay (waiting for the main thread to be free), processing time (your event handlers), and presentation delay (rendering the result). To diagnose, record a performance trace in Chrome DevTools while interacting, and look for long tasks, which are tasks over 50 ms.

Fixes that work:

  • Break up long tasks. Yield to the main thread between chunks of work using scheduler.yield() where available, or setTimeout/await patterns as a fallback. Process large lists in batches.
  • Do less in the handler. Update the visible state first and defer analytics, logging and non-urgent work with requestIdleCallback or after paint.
  • Reduce rendering cost. In React and similar frameworks, avoid re-rendering large trees on every keystroke: memoize expensive components, virtualize long lists, and use transitions (useTransition) to mark updates as non-urgent.
  • Ship less JavaScript. Every kilobyte must be downloaded, parsed and executed. Code-split by route, remove unused dependencies, and replace heavy libraries with lighter ones. Audit with a bundle analyzer; it is common to find a date or charting library that accounts for 20 percent of the bundle.
  • Avoid layout thrashing. Reading layout properties (offsetHeight) after writing styles forces synchronous reflow. Batch reads and writes.
  • Move heavy computation off the main thread with Web Workers.
  • Control hydration. Partial or progressive hydration, islands architecture and server components reduce the amount of client work competing with the first interactions.

You cannot optimize responsiveness by tuning a number in a lab. You optimize it by finding the one interaction users hit that blocks the main thread for 400 milliseconds.

Improving CLS

Layout shift happens when elements change size or position after they were first rendered. The common causes are few and mostly solved by reserving space.

  • Images, videos and iframes without dimensions. Always specify them.
  • Ads, embeds and consent banners injected above existing content. Reserve a fixed-size container with min-height, and prefer placing banners as overlays or at the bottom.
  • Late-loading web fonts, covered above.
  • Content inserted above the viewport in response to async data, such as “related” bars. Insert below existing content or reserve space.
  • Animations that animate layout properties like top, height or margin. Animate transform and opacity instead; they do not cause layout shift.

Note that CLS accumulates over the whole page life, in session windows, so it includes shifts during scrolling and after load. Single page applications need care because soft navigations are not yet fully measured identically across tools. Test the full journey, not only the landing page.

DevTools’ Performance panel highlights layout shifts, and the web-vitals attribution reports the shifting element so you can fix it directly.

Third-party scripts

Third parties are usually the single biggest controllable cost: analytics, tag managers, chat widgets, A/B testing tools, social embeds, ad networks. They compete for the main thread and network, and they change without your deployment.

A governance routine helps:

  1. Inventory every third-party script and assign an owner and a business reason.
  2. Measure each one’s cost: transfer size, main-thread time, and requests triggered. Chrome DevTools and WebPageTest group requests by domain.
  3. Remove what nobody can justify. Tag managers accumulate years of abandoned tags.
  4. Load the rest late: async or defer, and for non-essential widgets load on interaction or when scrolled into view. A chat widget does not need to load before the user can read the page.
  5. Use facades for heavy embeds. Show a static thumbnail of a video with a play button, and load the player on click.
  6. Run expensive tags in a worker where compatible, using tools such as Partytown, and test carefully.
  7. Use preconnect only for origins you will certainly need soon; excessive hints waste connections.

Keep an eye on A/B testing scripts that hide the page until the experiment loads; they directly damage LCP.

Caching and delivery

Good delivery multiplies every other optimization. Put static assets on a CDN with long Cache-Control: public, max-age=31536000, immutable and content-hashed filenames. Enable Brotli compression for text. Use HTTP/2 or HTTP/3. For HTML, consider edge caching with short TTLs and stale-while-revalidate, or incremental static regeneration. The browser’s back/forward cache can make back navigation instant; avoid unload handlers and Cache-Control: no-store on pages where you can, since they disable it.

A working process

Performance work fails when it is a one-off project. A sustainable loop:

  1. Collect field data and identify the worst page templates by traffic times failure rate.
  2. Diagnose the dominant phase for each metric using attribution data and a lab trace.
  3. Fix one thing, deploy behind a normal release, and watch the field metric for at least two weeks, since CrUX uses a rolling 28-day window.
  4. Add a regression guard: CI budget, alert on p75 degradation in RUM.
  5. Make performance a review criterion for new dependencies and third-party tags.

See the web.dev documentation on Core Web Vitals for current thresholds and guidance, since definitions and tooling evolve.

Key takeaways

  • Measure real users at the 75th percentile with attribution data, and use lab tools only to diagnose and to guard against regressions.
  • For LCP, make the hero resource discoverable in the HTML, give it high priority, never lazy-load it, and keep TTFB low.
  • For INP, find long tasks, ship less JavaScript, yield to the main thread and reduce rendering work in event handlers.
  • For CLS, reserve space for images, embeds, ads and fonts, and animate only transform and opacity.
  • Govern third-party scripts with an inventory, an owner for each, deferred loading and facades.
  • Treat performance as a continuous loop with budgets and alerts, not a one-time cleanup.
#web performance#core web vitals#lcp#inp#cls
DI
Datainter TeamEngineers, designers and operators building software and fintech products from Medellín, Tigard and Luxembourg.

Building something in this space?

Talk to the team that ships and operates it. We reply within one business day.

Start a project
Chat with us on WhatsAppUSUALLY REPLIES WITHIN MINUTES