Blog

Core Web Vitals for Drupal: where the real gains are

Measured at your real visitors, not in Lighthouse.

Where the real gains for Core Web Vitals sit in a Drupal site, at the 75th percentile of your page views.


Core Web Vitals gemeten op een Drupal-website

Core Web Vitals are three measurements from real visitors' browsers, not a Lighthouse score.
Google judges your site on the 75th percentile of page views, so three quarters of your visitors need to fall within the threshold.
A test on your own fibre connection says nothing about someone on a three year old Android phone on 4G.

LCP, INP and CLS: the three values and their thresholds

The three values measure loading speed, responsiveness and visual stability, each with its own threshold.
Largest Contentful Paint is the moment the largest element appears on screen, usually an image or a heading.
Interaction to Next Paint is the time between an interaction (click, tap or keystroke) and the next frame.
Of all the interactions in a visit, Google keeps the longest, apart from a few outliers, not the average, so a handful of slow clicks determines your score.
Cumulative Layout Shift is the heaviest sequence of shifts that the visitor didn't cause themselves, such as text jumping while a font loads: Google adds up the shifts within a window of at most five seconds and reports the heaviest window, not all the shifts on the whole page combined.

Value Good Needs improvement Poor
LCP 2.5 seconds or less 2.5 to 4 seconds more than 4 seconds
INP 200 milliseconds or less 200 to 500 milliseconds more than 500 milliseconds
CLS 0.1 or less 0.1 to 0.25 more than 0.25

INP replaced First Input Delay on 12 March 2024, so a report that still shows FID is measuring something that no longer counts.

Measure first, tune later

Field data determine your rating, lab tools only explain why.
PageSpeed Insights shows the real measurements from the Chrome User Experience Report over the past 28 days, and below that a Lighthouse test in a simulated environment.

Search Console groups that field data per set of URLs, so you can see how many pages are failing.
A score of 100 in Lighthouse says little on its own, because lab tools can't measure INP without a real interaction.
How you tell lab and field data apart, and how you track down exactly where a slow site gets stuck, is covered in why your PageSpeed score isn't your speed; below, I'll carry on with the actual optimising.

Eerst meten, dan pas bijsturen bij Core Web Vitals

Caching: where Drupal has the most to gain

Dynamic Page Cache also works for logged in users and stores the page with placeholders for whatever differs per user.
It depends entirely on correct cache metadata: a block that returns max-age 0 at page level makes the whole page uncacheable, and cache contexts that vary by query string fragment your cache.

BigPipe has been stable in core since Drupal 8.3 and has been on by default in the Standard profile since 8.5.
It sends the page skeleton immediately and fills in the dynamic parts afterwards.
The work doesn't get smaller, just redistributed.

On top of that, I put a reverse proxy or CDN with invalidation on cache tags, because the edge responds without PHP.

Images: almost always the LCP element

On most Drupal sites, the LCP element is an image, and that's where the fastest win is.
Core has converted to WebP in an image style since Drupal 9.2, and to AVIF with a fallback since Drupal 11.2.
Use responsive image styles, so a phone doesn't pull in a desktop file.

Watch out for one detail where core works against you: since Drupal 9.1, images get loading="lazy" by default.
For your hero image that's exactly wrong, because it makes the browser defer the most important file.
Set it to eager, give it a high fetchpriority and fill in width and height so the space stays reserved.
Since Drupal 9.4 you set that per field in the UI.
To be honest: taking a hero image from 1.8 MB to 150 kB gains you more than all the other measures combined, and converting a 40 kB thumbnail to AVIF gets you nothing measurable.

CSS and JS: aggregate, then cut

Aggregation should be on, but it's rarely your biggest problem.
Since Drupal 10.1, core no longer builds the aggregates while rendering the page, but through its own route when the file is requested, which shaves hundreds of milliseconds off a cold request.
On Drupal 9 or older you miss out on that. Drupal 10 reaches end of life on 9 December 2026, the same week Drupal 12 comes out, so an upgrade path is already on the schedule for most sites anyway.

The real win is in what you don't load.
A slider library sitting globally in your theme's libraries.yml, a contrib module that drags jQuery onto every page, a tag manager pulling in three external scripts: those are the long tasks that push your INP above 200 milliseconds.
Aggregating doesn't make those scripts shorter.

Fonts: a small problem, a reliable source of CLS

Fonts are rarely your LCP, but they are the most predictable cause of layout shift.
Host them in your theme instead of through an external stylesheet, since that saves a connection.

Use font-display swap, preload the one file needed above the fold, and tune your fallback with size-adjust or ascent-override.
Without that tuning, swap trades invisible text for a shift instead.
Two families with three weights each is usually one weight too many.

Views that do too much

A view that does too much is the most underestimated cause of slow Drupal pages.
The classic combination: rendered entity as the row style on a list of fifty items, which builds fifty full entity views instead of a handful of fields.
On top of that, filters and relationships that add joins, node access joins on sites with fine grained permissions, a pager set to a hundred, and render caching switched off.

A nuance that often gets lost: if your page cache is set up correctly, only the first visitor after a cache clear pays the price.
You then see a heavy view show up as spikes in your TTFB, not in your median.

What doesn't help, measurably

Some of what gets sold as performance work changes nothing in your field data.
Chasing a Lighthouse score of 100 while your field data are already green, minifying a few kilobytes, adding another cache module on top of the three layers already in core, or preloading everything at once so the requests compete for bandwidth.
Core Web Vitals are also just one signal in Google's assessment, and content weighs more heavily, so you make a page faster for your visitor, not for Google.

Where I'd start

  1. Pull the field data from Search Console and note which value fails.
  2. Separate TTFB from the rest: if that's high, it's caching.
  3. Check the three cache layers in core, including what disables them.
  4. Identify the LCP element and tackle that one file.
  5. Clean up views and globally loaded scripts, ordered by impact.
  6. Measure again after 28 days, since field data shift slowly.

If your site is stuck on one of the three values, I'll map out where it originates and fix it in the code.
That work falls under technical SEO and frontend performance, the follow up after that under technical management and consultancy.
Send your site through the contact form, you'll have an answer within 24 hours.

Frequently asked questions

How do you make a Drupal website faster?

You make a Drupal website faster by shrinking the slowest step, not by optimising everything a little.
The order is almost always the same: first the cache layers, then the LCP element, then the scripts loaded on every page, then the views.
You're working towards an LCP of 2.5 seconds, an INP of 200 milliseconds and a CLS of 0.1.

Which Drupal cache layers should I have turned on?

Internal Page Cache for anonymous visitors, Dynamic Page Cache for logged-in users and BigPipe for the dynamic parts: all three are in core and all three should be on.
On top of that I add a reverse proxy or CDN with invalidation on cache tags, since the edge responds without PHP.
Watch especially for what disables those layers, such as code that starts a session on every page or a block that returns max-age 0.

Should I turn off lazy loading on my hero image?

Yes.
Since Drupal 9.1, images get loading="lazy" by default, and on the LCP element that works against you: the browser defers exactly the most important file.
Set that image to eager, give it a high fetchpriority, and fill in width and height so the space stays reserved.
Since Drupal 9.4 you can set that per field in the UI.

How do I get my INP under 200 milliseconds?

You improve INP by removing JavaScript, not by shrinking it.
The usual causes are a library loaded globally in your theme's libraries.yml, a contrib module that drags jQuery onto every page, and a tag manager that pulls in external scripts.
Aggregating doesn't make those scripts shorter, so only load them on the pages where they're actually needed.

Do Core Web Vitals factor into Google's rankings?

Core Web Vitals are one of the signals Google uses to assess page experience, but relevance and content weigh more heavily.
Bringing a site from red to green rarely delivers a jump in positions, while an LCP going from five to two seconds is noticeable to whoever uses your site.
So treat it as work for your visitor, with findability as a side effect.

Does BigPipe help my Core Web Vitals?

BigPipe mainly helps on logged-in and personalised pages, and has been stable in core since Drupal 8.3 and on by default in the Standard profile since 8.5.
It sends the page skeleton immediately and fills in the dynamic blocks afterwards, so the visitor sees something usable sooner.
For an anonymous visitor getting a fully cached page, BigPipe changes almost nothing.

A question about this topic?

Briefly describe your situation, and I'll let you know what's going on and what it would cost. No sales pitch.

Privacy policy
You can read how I handle your data in the privacy policy.

More to read