Learn

Core Web Vitals: how to make a slow page fast

A slow page loses visitors before they read a word. Google measures speed with three numbers, the Core Web Vitals. This guide explains what each one means, how to find the cause on your own pages, and which fixes to do first.

Updated · For agents: Markdown · skill

Three numbers, three questions

Google’s Core Web Vitals answer three questions a visitor asks without knowing it:

Metric The question Good Poor
Largest Contentful Paint (LCP) When can I see the main content? 2.5 s or less over 4 s
Interaction to Next Paint (INP) Does the page react when I tap? 200 ms or less over 500 ms
Cumulative Layout Shift (CLS) Does the page stay still while I read? 0.1 or less over 0.25

A page passes when three out of four real visits are in the good range. That detail matters: you are judged on your slower visitors, usually people on phones.

Many older guides and videos still mention First Input Delay (FID). INP replaced it in March 2024. FID only measured the delay before the first tap was handled. INP looks at every tap, click and key press during the visit and reports about the slowest one.

Measure before you change anything

There are two kinds of measurement, and you need both:

A lab test cannot measure INP, because nobody taps anything. It reports Total Blocking Time (TBT) instead: how long scripts kept the page busy while loading. A high TBT usually means a poor INP.

Test the pages that earn money, not only the home page: a product page, a category page, the cart. And test as a phone on a slow connection. A page that feels instant on your laptop can take eight seconds on a three-year-old Android.

Fix LCP: the main content appears late

Find out what the LCP element is first. Lighthouse names it, and it is nearly always the large image at the top or the main heading. Then work through the four places time can be lost:

  1. The server is slow to answer. If the HTML takes more than 0.8 seconds to arrive, nothing after it can be fast. Cache pages, use a CDN, and look at slow database queries.
  2. The browser finds the image late. An image set by JavaScript or as a CSS background is only discovered after those files load. Put it in the HTML as an <img> and add fetchpriority="high".
  3. The image is lazy-loaded. loading="lazy" is right for images further down. On the main image it delays the one thing you want first.
  4. The image is heavy. Serve WebP or AVIF, at the size it is shown. A 3000 px photo in a 400 px slot wastes most of the download.

Then clear the path in front of it. Scripts in the head without defer or async, and large stylesheets, hold back everything on the page until they finish.

Fix INP: the page reacts late

A browser can do one thing at a time on its main thread. While it runs a long script, it cannot respond to a tap. The fix is always less work, or work in smaller pieces:

Fix CLS: the page jumps

Layout shift happens when something loads late and pushes the content down, often just as the visitor is about to tap. The usual causes:

What to do first

Fix in the order of the page load, because early delays make every later number worse:

  1. Server response time.
  2. The main image: in the HTML, prioritised, not lazy, small.
  3. Render-blocking scripts and styles.
  4. Sizes on images and embeds.
  5. JavaScript weight and third-party scripts.
  6. Compression and caching.

Measure again after each change. A fix that looked obvious sometimes moves nothing, and you want to know that before you do the next one.

Speed does not stay fixed

A new tracking script, a larger hero image or a plugin update can undo all of this in one release. Check the same pages on the same phone profile after every change to the site, and keep the numbers, so you can see which change made a page slower. A free WitnessQA audit measures these on a phone profile and names the file or image behind each issue.

Watch

Two videos that explain the same ground, both a few years old and still using FID where INP now applies:

The checklist

Every step says what to do and how to verify it from outside. The tags are the WitnessQA checks that verify it for you in a free audit. Agents can load the same list as a skill file.

  1. Measure on a phone, not on your desk

    Test each key page with a mid-range phone profile on a slow 4G connection. A fast laptop on office wifi hides most problems.

    Verify: Run the page in a browser with phone emulation and network throttling. Record Largest Contentful Paint, Cumulative Layout Shift and Total Blocking Time.

  2. Get the server to answer quickly

    The first byte of the HTML arrives within 0.8 seconds. Cache pages that do not change per visitor and serve them from a CDN.

    Verify: Request the page and time the first byte of the response. It is at most 0.8 s.

  3. Let the browser find the main image early

    The largest image on the first screen is an <img> in the HTML with fetchpriority="high", not lazy-loaded and not added by a script or a CSS background.

    Verify: Read the HTML the server sends. The main image is in it, without loading="lazy".

  4. Make images small

    Serve images in WebP or AVIF, at about the size they are shown, and compress the main image hardest.

    Verify: List the images on the page. None is far larger than its displayed size, and large ones are not JPEG or PNG.

  5. Remove what blocks the first paint

    Load scripts with defer or async, inline the small amount of CSS the first screen needs, and drop stylesheets and scripts the page does not use.

    Verify: Read the head of the page. No script without defer or async, and no large stylesheet, sits before the content.

  6. Send less JavaScript

    Remove unused libraries, split the code per page, and load widgets such as chat and maps only when they are needed.

    Verify: Add up the JavaScript the page downloads. Total Blocking Time is at most 200 ms.

  7. Reserve the space for everything that loads late

    Every image and video has width and height. Banners, ads and embeds get a box of fixed size before they load.

    Verify: List the <img> elements. Each has width and height or a CSS aspect ratio. Cumulative Layout Shift is at most 0.1.

  8. Show text while fonts load

    Use font-display: swap or optional, and load as few font files as the design needs.

    Verify: Read the @font-face rules. Each has a font-display value other than block.

  9. Compress and cache files

    Send text files with Brotli or gzip. Give files with a hash in their name a long Cache-Control max-age.

    Verify: Read the response headers of the CSS and JavaScript files. Each has content-encoding and a cache-control max-age of at least a week.

  10. Keep the page light

    Keep the total download of a page small enough for a phone on mobile data.

    Verify: Add up everything the page downloads on first load and compare it with the last measurement.

See which of these your site passes, with evidence for each.

Run a free audit