Skip to main content

Core Web Vitals Optimization

Targeted optimization for the three Core Web Vitals metrics that affect Google Search ranking and user experience.

The Three Metrics

Google measures at the 75th percentile — 75% of page visits must meet “Good” thresholds.

LCP: Largest Contentful Paint

LCP measures when the largest visible content element renders. Usually this is:
  • Hero image or video
  • Large text block
  • Background image
  • <svg> element

Common LCP Issues

Fix: CDN, caching, optimized backend, edge rendering

LCP Optimization Checklist

  • TTFB < 800ms (use CDN, edge caching)
  • LCP image preloaded with fetchpriority=“high”
  • LCP image optimized (WebP/AVIF, correct size)
  • Critical CSS inlined (< 14KB)
  • No render-blocking JavaScript in <head>
  • Fonts don’t block text rendering (font-display: swap)
  • LCP element in initial HTML (not JS-rendered)

LCP Element Identification

INP: Interaction to Next Paint

INP measures responsiveness across ALL interactions (clicks, taps, key presses) during a page visit. It reports the worst interaction (at 98th percentile for high-traffic pages).

INP Breakdown

Total INP = Input Delay + Processing Time + Presentation Delay

Common INP Issues

INP Optimization Checklist

  • No tasks > 50ms on main thread
  • Event handlers complete quickly (< 100ms)
  • Visual feedback provided immediately
  • Heavy work deferred with requestIdleCallback
  • Third-party scripts don’t block interactions
  • Debounced input handlers where appropriate
  • Web Workers for CPU-intensive operations

INP Debugging

CLS: Cumulative Layout Shift

CLS measures unexpected layout shifts. A shift occurs when a visible element changes position between frames without user interaction. CLS Formula: impact fraction × distance fraction

Common CLS Causes

CLS Optimization Checklist

  • All images have width/height or aspect-ratio
  • All videos/embeds have reserved space
  • Ads have min-height containers
  • Fonts use font-display: optional or matched metrics
  • Dynamic content inserted below viewport
  • Animations use transform/opacity only
  • No content injected above existing content

CLS Debugging

Measurement Tools

Lab Testing

  • Chrome DevTools → Performance panel, Lighthouse
  • WebPageTest → Detailed waterfall, filmstrip
  • Lighthouse CLI → npx lighthouse <url>

Field Data (Real Users)

  • Chrome User Experience Report (CrUX) → BigQuery or API
  • Search Console → Core Web Vitals report
  • web-vitals library → Send to your analytics

Framework Quick Fixes

External Resources

Performance Skill

For general performance optimization beyond Core Web Vitals