Web Performance & Core Web Vitals
LCP, CLS, INP — what Google measures and how to improve each
Skills taught: web.core-web-vitals, web.lcp, web.cls, web.inp, web.performance-basics
The three Core Web Vitals
Metric Full Name Measures Good Needs work Poor
────── ─────────────────────────── ─────────────────── ──────── ────────── ─────
LCP Largest Contentful Paint Loading speed < 2.5s 2.5–4.0s > 4.0s
CLS Cumulative Layout Shift Visual stability < 0.1 0.1–0.25 > 0.25
INP Interaction to Next Paint Responsiveness < 200ms 200–500ms > 500ms
Google uses the 75th percentile of real user data for Search ranking.
'Good' = 75% of page loads meet the threshold.
LCP — Largest Contentful Paint
LCP measures how long it takes to render the largest visible element in the viewport — usually a hero image, article photo, or large heading. It answers: 'When did the user see the main content?'
- Common causes of slow LCP: Large uncompressed images, render-blocking CSS/JS delaying first paint, slow server response (high TTFB), no CDN
- Fixes: Compress and resize images (WebP/AVIF format), add
<link rel="preload" as="image"> for the hero image, use a CDN, inline critical CSS
CLS — Cumulative Layout Shift
CLS measures how much the page jumps around while loading. A score of 0 means nothing moved. 0.1 means there was some shifting. High CLS happens when images, ads, or fonts load and push content down.
<!-- BAD: no dimensions → image loads and pushes content down -->
<img src="hero.jpg" alt="Hero">
<!-- GOOD: reserve space before image loads -->
<img src="hero.jpg" alt="Hero" width="800" height="400">
<!-- GOOD: CSS aspect-ratio to reserve space -->
<div style="aspect-ratio: 2/1">
<img src="hero.jpg" alt="Hero" style="width:100%">
</div>
<!-- Fonts: prevent text jumping (FOUT) -->
<style>
@font-face {
font-family: 'MyFont';
src: url('font.woff2');
font-display: swap; /* show system font immediately, swap when loaded */
}
</style>
INP — Interaction to Next Paint
INP measures how quickly the page responds to user interactions (clicks, taps, keyboard input). A high INP means buttons feel laggy — the browser was busy with JavaScript when you clicked.
- Cause: Long JavaScript tasks (> 50ms) blocking the main thread. Happens when you load too much JavaScript upfront or run heavy computations synchronously.
- Fix: Code-split and lazy-load JavaScript. Break up long tasks with setTimeout/scheduler.yield(). Move CPU-heavy work to Web Workers.
Tip: Quick wins for all three metrics: Compress images to WebP, set width/height on all images, add defer to scripts, use a CDN, enable gzip/Brotli compression on your server.
Frequently Asked Questions
How do I measure Core Web Vitals for my site?
Three ways: (1) Lighthouse in DevTools — lab measurement simulating a mid-range device on 3G. (2) PageSpeed Insights (pagespeed.web.dev) — combines lab data with real user CrUX data. (3) Google Search Console → Core Web Vitals report — shows real-world data from Chrome users visiting your site over 28 days. CrUX data is only available for pages with enough traffic.
Does improving Core Web Vitals actually improve Google rankings?
Yes, but it is one signal among many. Google uses Page Experience signals (including Core Web Vitals) as a tiebreaker — if two pages have equivalent content quality, the faster page ranks higher. For most sites, content relevance still dominates ranking. Think of Core Web Vitals as the performance floor you should not fall below, not the primary driver of SEO.