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
1. Slow Server Response (TTFB > 800ms)
1. Slow Server Response (TTFB > 800ms)
Fix: CDN, caching, optimized backend, edge rendering
2. Render-Blocking Resources
2. Render-Blocking Resources
3. Slow Resource Load Times
3. Slow Resource Load Times
4. Client-Side Rendering Delays
4. Client-Side Rendering Delays
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 DelayCommon INP Issues
- Long Tasks
- Heavy Handlers
- Third-Party Scripts
- Re-renders
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
1. Images Without Dimensions
1. Images Without Dimensions
2. Ads, Embeds, and Iframes
2. Ads, Embeds, and Iframes
3. Dynamically Injected Content
3. Dynamically Injected Content
4. Web Fonts Causing FOUT
4. Web Fonts Causing FOUT
5. Animations Triggering Layout
5. Animations Triggering Layout
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
- Next.js
- React
- Vue/Nuxt
External Resources
Performance Skill
For general performance optimization beyond Core Web Vitals