Core Web Vitals
Thresholds (75th percentile of page loads, mobile and desktop separately)
| Metric | Good | Needs improvement | Poor |
|---|---|---|---|
| LCP - Largest Contentful Paint | <= 2.5 s | 2.5 - 4.0 s | > 4.0 s |
| INP - Interaction to Next Paint | <= 200 ms | 200 - 500 ms | > 500 ms |
| CLS - Cumulative Layout Shift | <= 0.1 | 0.1 - 0.25 | > 0.25 |
INP replaced First Input Delay (FID) as a Core Web Vital in March 2024. Ignore advice that optimizes FID.
1. Start from field data
Lab scores (Lighthouse) are a single simulated load; Google’s assessment uses real-user field data. Get it from PageSpeed Insights (CrUX section), Search Console’s Core Web Vitals report, or your RUM tool. If the site has no field data, add the web-vitals library and send metrics with attribution to your analytics.
Identify which metric fails, on which page templates, on which device class. Fix the worst template first.
2. LCP: find the LCP element, then the slow phase
LCP = time to first byte + resource load delay + resource load time + element render delay. In Chrome DevTools Performance panel (or the web-vitals attribution build) find the LCP element and which phase dominates.
| Slow phase | Fixes |
|---|---|
| TTFB | CDN/edge caching for HTML, avoid redirects, faster server rendering, cache database work |
| Load delay (image discovered late) | Put the LCP image in the HTML as <img> (not CSS background or JS-inserted); fetchpriority="high" on it; never loading="lazy" on the LCP image; <link rel="preload"> only if it cannot be in the HTML |
| Load time | Correct size via srcset/sizes, modern formats (AVIF/WebP), compression, CDN |
| Render delay | Remove render-blocking CSS/JS (inline critical CSS, defer scripts), avoid client-side rendering of the hero, font loading that hides text (font-display: swap or optional) |
3. INP: make interactions respond fast
INP measures the delay from a user interaction until the next frame paints, across the visit (roughly the worst interaction).
- Find slow interactions:
web-vitalsattribution (interactionTarget,inputDelay,processingDuration,presentationDelay) or DevTools Performance with interactions recorded. - Input delay (main thread busy when user clicks): break up long tasks (> 50 ms) from third-party scripts, hydration, timers. Defer non-critical JS; load third parties after interaction or idle.
- Processing time (your handler is slow): do the minimum to update the UI, then yield (
await scheduler.yield()where supported, with asetTimeout(0)fallback) before heavy work; move heavy work to a Web Worker; debounce input handlers. - Presentation delay (rendering the update is slow): smaller DOM, avoid layout thrashing (batch reads before writes),
content-visibility: autofor long off-screen content, avoid re-rendering huge component trees (memoization, virtualization of long lists).
4. CLS: reserve space
- Always set
widthandheightattributes (oraspect-ratio) on images, video, iframes and ad slots. - Reserve space for late content (banners, embeds, ads) with min-height containers; insert new content below the viewport or in response to user action.
- Fonts:
font-display: optionalor matched fallback metrics (size-adjust,ascent-override) to avoid layout shift on swap. - Animate with
transform/opacity, nevertop/left/height. - Back/forward cache eligibility helps all three metrics on return visits (avoid
unloadhandlers,Cache-Control: no-storeon HTML where not needed).
5. Verify
Measure the same template before and after in the lab (Lighthouse/DevTools with the same throttling), then confirm in field data over the following days (CrUX data in PageSpeed Insights is a rolling 28-day window, so it moves slowly).
Report: metric, page template, root cause with evidence, fix, lab before/after, and what to watch in field data.