Skip to main content

Core Web Vitals

Fix Core Web Vitals at the server layer

Core Web Vitals are the three field metrics Google uses to score loading, visual stability, and responsiveness: Largest Contentful Paint (LCP), Cumulative Layout Shift (CLS), and Interaction to Next Paint (INP). Each is defined below, with the concrete fix for WordPress, WooCommerce, Magento, nginx, and ASP.NET Core.

What the three metrics measure

Each metric has a field measurement, taken from real Chrome users over the trailing 28 days in the CrUX dataset, and a lab approximation from Lighthouse or PageSpeed Insights. The two routinely disagree, because real visitors run slower hardware on slower connections than the machine you test on. Optimize toward the field number.

Largest Contentful Paint

LCP

The render time of the largest element visible in the viewport during load — often a hero image, a banner, or the first heading. Under 2.5 s is good; over 4 s is poor.

Typical causes: the hero image is not preloaded, a chain of render-blocking stylesheets delays first paint, or a large unoptimized image takes too long to download.

Fix LCP →

Cumulative Layout Shift

CLS

The largest burst of unexpected layout shifts while the page is open; each shift counts by how much of the viewport moved and how far. Under 0.1 is good; 0.25 and up is poor.

Typical causes: images and embeds without explicit width and height, web fonts that reflow text on swap, and content injected above what the user is already reading.

Fix CLS →

Interaction to Next Paint

INP

The time from a click, tap or key press to the next frame the browser paints. A page’s INP is close to its slowest interaction (the browser ignores one outlier for every 50 interactions). Under 200 ms is good; over 500 ms is poor.

Typical causes: long JavaScript tasks blocking the main thread, heavy event handlers, and frameworks whose interaction model requires a round-trip before paint.

Fix INP →

Core Web Vitals optimization techniques

Core Web Vitals are Google’s three field metrics for loading, visual stability and responsiveness. A page passes when 75% of real visits have an LCP of 2.5 seconds or less, a CLS of 0.1 or less and an INP of 200 ms or less. Fix them by fetching the LCP image early, reserving space for late content and cutting long JavaScript tasks.

LCP

  • Preload the LCP image and do not lazy-load it.
  • Inline critical CSS and defer the rest of the render-blocking stylesheets.
  • Serve the hero image as WebP or AVIF at the size the viewport needs.
  • Cut server response time, because every millisecond of TTFB is added to LCP.

LCP guides →

CLS

  • Set explicit width and height on images and embeds.
  • Reserve space for ads, banners and other content injected late.
  • Match fallback and web font metrics so text does not reflow on swap.
  • Never insert content above what the visitor is already reading.

CLS guides →

INP

  • Break long main-thread tasks into smaller ones.
  • Keep event handlers light and defer non-urgent work until after the next paint.
  • Remove or delay third-party scripts that compete for the main thread.
  • Server-side optimization helps only indirectly, by trimming startup script. The fix lives in your application code.

INP guides →

The full list of optimizations, with which ones a server can apply for you, is in the PageSpeed optimization guide.

Per-platform fix guides

The same metric fails for different reasons on different stacks. Pick your platform and your metric to read the diagnosis and the concrete fix. On WordPress, start with the WordPress speed guide.

How mod_pagespeed helps

mod_pagespeed optimizes responses at the server layer, below the CMS, so a single configuration applies to every URL the origin serves. That maps directly onto LCP and CLS. It maps less directly onto INP. For the same split by resource type, see which PageSpeed optimizations a server can automate.

LCP: materially helped

Heuristic critical CSS extraction (optimizer worker; opt-in in the native module) inlines above-the-fold rules and defers the rest, removing the render-blocking stylesheet chain that delays first paint. Image transcoding to WebP and AVIF, plus responsive variants sized to the viewport, shrinks the hero image so it downloads sooner. The detected LCP image receives a preload hint so the browser starts fetching it earlier. Each of these attacks a distinct part of the LCP timing breakdown.

CLS: materially helped

The optimizer worker adds explicit width and height on <img> tags that lack them, using dimensions read from the cached image data; in the native module the same transform, insert_image_dimensions, is opt-in. That lets the browser reserve the correct layout box before pixels arrive, which removes the most common source of image-driven layout shift. Inlined critical CSS also stabilizes early layout by making above-the-fold styling available without waiting on external stylesheets.

INP: helped less directly

INP is a measure of JavaScript main-thread responsiveness. The dominant cause of poor INP is long tasks in your own application code — event handlers, hydration, framework work — and a server-layer optimizer does not rewrite that logic. mod_pagespeed will not make a slow click handler fast.

What it can do is reduce how much JavaScript competes for the main thread before the user interacts: minifying scripts and deferring those it can prove are safe to defer moves parser-blocking work off the critical path, which can lower INP on pages whose responsiveness was being throttled by startup script execution. Where INP is structural — for example a Blazor Server interaction that is a network round-trip by design, or a heavy client framework — the fix lives in your application, not in the server layer. The per-platform guides above are explicit about which case you are in.

Core Web Vitals: common questions

What are Core Web Vitals, and how do you optimize them?
Core Web Vitals are the three field metrics Google uses to measure real-world page experience: Largest Contentful Paint (loading), Cumulative Layout Shift (visual stability) and Interaction to Next Paint (responsiveness). Optimize them by fetching the LCP image early, reserving space for late content, and cutting long JavaScript tasks.
What are the three Core Web Vitals?
Largest Contentful Paint (LCP), which measures loading; Cumulative Layout Shift (CLS), which measures visual stability; and Interaction to Next Paint (INP), which measures responsiveness. INP replaced First Input Delay as a Core Web Vital in March 2024.
What is a good Core Web Vitals score?
A page passes when the 75th percentile of real users meets all three thresholds: LCP of 2.5 seconds or less, CLS of 0.1 or less, and INP of 200 milliseconds or less. Meeting these at the 75th percentile means three out of four visits are good or better.
Are Core Web Vitals a Google ranking factor?
Yes. Core Web Vitals are part of Google’s page experience signals and contribute to ranking, though relevance and content quality remain far stronger signals. They are most likely to be a tie-breaker between pages of comparable relevance.
How do I improve my Core Web Vitals?
Fix the dominant cause of each metric: preload the LCP image and remove render-blocking CSS for LCP; set explicit image dimensions and reserve space for late content for CLS; and reduce long main-thread JavaScript tasks for INP. mod_pagespeed can address most of the LCP and CLS causes at the server layer; some filters are opt-in. INP fixes usually live in your application code.
What is the difference between lab and field Core Web Vitals data?
Field data comes from real Chrome users over the trailing 28 days (the CrUX dataset) and is what Google uses for ranking. Lab data is a single synthetic test from Lighthouse or PageSpeed Insights. The two routinely disagree because real visitors run slower hardware on slower connections — optimize toward the field number.
Can a server-side optimizer fix Core Web Vitals?
It can fix LCP and CLS directly, because those are driven by how assets and markup are delivered — image transcoding, critical CSS, and injected image dimensions all apply below the CMS. INP is driven by your own JavaScript main-thread work, so a server-layer optimizer helps only indirectly, by reducing competing startup script.

Measure your own pages

Start with a measurement, not a guess. Run a page through the analyzer to see what is driving its Core Web Vitals, then read the matching per-platform guide. When you are ready to fix it at the server layer, download and run mod_pagespeed; it starts optimizing from the first requests, and it is free in development and in production.

See also:

Search