← CodeClarityLab Home
Browse by Category
+ added · updated 7d
← Back to glossary

Core Web Vitals & Page Performance

frontend Intermediate

Also Known As

Core Web Vitals page performance LCP FID CLS

TL;DR

Google's Core Web Vitals — LCP, INP, CLS — measure real user experience and directly influence search ranking.

Explanation

Core Web Vitals (2024 set): LCP (Largest Contentful Paint, <2.5s good) — time until the largest image or text block renders; INP (Interaction to Next Paint, <200ms good, replaces FID) — responsiveness to user interactions; CLS (Cumulative Layout Shift, <0.1 good) — visual stability, unexpected layout movements. Optimising LCP: serve images in WebP/AVIF, use rel='preload' for hero images, server-side render critical content, use a CDN. Optimising INP: break up long tasks with scheduler.yield(), use web workers for heavy JS. Optimising CLS: always specify width/height on images and iframes, avoid inserting content above existing content. Measure with Lighthouse, PageSpeed Insights, or field data from Chrome UX Report. For PHP applications, server response time (TTFB) directly affects LCP.

Common Misconception

A fast server response time guarantees good web performance. Server response time (TTFB) is one factor — render-blocking scripts, large unoptimised images, layout shifts, and JavaScript execution time all affect user-perceived performance independently of server speed.

Why It Matters

Web performance directly impacts user experience and revenue — a 1-second delay in mobile page load reduces conversions by 20%, and Google uses Core Web Vitals as a ranking signal.

Common Mistakes

  • Render-blocking JavaScript in <head> without async or defer attributes.
  • Large unoptimised images — the single biggest contributor to page weight.
  • No lazy loading for below-the-fold images — loading=lazy is a one-attribute fix.
  • Not measuring with real users (RUM) — synthetic tests miss real-world network and device conditions.

Code Examples

✗ Vulnerable
<!-- Render-blocking resources in <head>: -->
<head>
  <script src="large-bundle.js"></script>  <!-- Blocks rendering -->
  <link rel="stylesheet" href="all-styles.css">  <!-- Blocks rendering -->
</head>

<!-- Non-blocking: -->
<script src="large-bundle.js" defer></script>
<link rel="preload" href="critical.css" as="style">
✓ Fixed
<!-- Preload critical resources -->
<link rel="preload" as="image" href="hero.webp" fetchpriority="high">
<link rel="preload" as="font" href="/fonts/sora.woff2" crossorigin>

<!-- Lazy-load below-fold images -->
<img src="product.webp" loading="lazy" decoding="async"
     width="800" height="600" alt="Product photo">

<!-- Avoid layout shift — always specify dimensions -->
<img width="1200" height="630" src="banner.webp" alt="">

<!-- Defer non-critical JS -->
<script src="analytics.js" defer></script>
<script src="chatwidget.js" async></script>

<!-- Reduce INP: break up long tasks -->
// In JS:
await scheduler.yield(); // hand control back to browser between chunks

Added 15 Mar 2026
Edited 22 Mar 2026
Views 27
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings F 0 pings S 2 pings S 1 ping M 0 pings T 0 pings W 0 pings T 1 ping F 0 pings S 2 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 2 pings S 0 pings M 0 pings T 1 ping W 0 pings T 0 pings F 0 pings S 2 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S
No pings yet today
No pings yesterday
Amazonbot 8 Perplexity 5 Google 2 Ahrefs 2 Unknown AI 2 SEMrush 2
crawler 20 crawler_json 1
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: High
⚡ Quick Fix
Audit with Lighthouse — fix LCP (preload hero image, fast server), CLS (set image dimensions), INP (remove long tasks), then reduce JS payload with code splitting
📦 Applies To
any web
🔗 Prerequisites
🔍 Detection Hints
Lighthouse score <90; LCP >2.5s; no image dimensions; render-blocking scripts in <head> without defer/async
Auto-detectable: ✓ Yes lighthouse pagespeed-insights webpagetest crux
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: Medium ✗ Manual fix Fix: Medium Context: File

✓ schema.org compliant