Services
All ServicesDrupal DevelopmentBusiness TransformationIndustries
Products
AI Smart Quality AssistantPMO AI PlatformAll Products
Portfolio Company
About UsCareersFAQ
Blog Schedule a Consultation
Drupal 11

Drupal 11 Performance Tuning: Caching, BigPipe and Core Web Vitals

Close-up of a circuit board representing performance engineering

Drupal 11 has one of the most sophisticated caching systems of any CMS. Most slow Drupal sites are not slow because of Drupal; they are slow because something prevents its caches from working. Fix that, and the rest is fine-tuning.

Know your caching layers

LayerWhat it does
Internal Page CacheStores full pages for anonymous visitors
Dynamic Page CacheCaches pages for all users, leaving personalized parts as placeholders
BigPipeSends the cached page immediately, then streams personalized placeholders
Render cacheCaches individual blocks and components
Reverse proxy / CDNServes pages from the edge (for example Varnish)

Get cache metadata right

Every render array should say what it depends on. Cache tags say which data it shows (invalidate when it changes), contexts say what it varies by, and max-age says how long it may live:

$build['latest_news'] = [
  '#theme' => 'item_list',
  '#items' => $items,
  '#cache' => [
    'tags' => ['node_list'],          // clear when any node changes
    'contexts' => ['languages:language_interface'],
    'max-age' => Cache::PERMANENT,
  ],
];

The most common mistake is a max-age of 0 or a user context on a block that appears on every page. One such block can disable caching site-wide.

Isolate personalization with lazy builders

A cart count or a "Hello, Sara" greeting should not make the whole page uncacheable. Render it with a lazy builder and let BigPipe stream it:

$build['greeting'] = [
  '#lazy_builder' => ['my_module.lazy_builders:greeting', []],
  '#create_placeholder' => TRUE,
];

The service method referenced here must be declared as a trusted callback.

Back-end tuning

  • Redis or Memcache for cache bins, so cache reads do not hit the database.
  • OPcache properly sized, with realpath cache tuned for large codebases.
  • Database: review slow query logs; heavy Views without caching are a frequent culprit.
  • Cron and queues: move heavy work (imports, emails, indexing) to queues, not page requests.

Enabling Redis with the contributed Redis module typically looks like this in settings.php:

$settings['redis.connection']['interface'] = 'PhpRedis';
$settings['redis.connection']['host'] = 'redis';
$settings['cache']['default'] = 'cache.backend.redis';

Front-end and Core Web Vitals

Google's Core Web Vitals measure Largest Contentful Paint (LCP), Interaction to Next Paint (INP) and Cumulative Layout Shift (CLS). In Drupal terms:

  • LCP: use responsive image styles, modern formats such as WebP via the image style "Convert" effect, and do not lazy-load the hero image.
  • INP: keep JavaScript lean; audit contrib libraries attached on every page.
  • CLS: always output image width and height, and reserve space for embeds and banners.
  • Keep CSS and JavaScript aggregation enabled in production.

A 30-minute performance audit

  1. Request a page twice as anonymous: is the second response a cache hit?
  2. Check response headers for X-Drupal-Cache and X-Drupal-Dynamic-Cache.
  3. Use Webprofiler or similar to find uncacheable blocks.
  4. Run PageSpeed Insights on your top templates and fix the biggest LCP issue first.

Need a deeper review? Our Drupal performance engineers can audit your stack end to end.

3P Technologies Engineering

Our team builds enterprise Drupal platforms, mobile apps and AI products from Amman, Jordan. About us

Keep reading

Related articles

All articles
Need an enterprise implementation?

Put our engineers on your project.

Our team specializes in Drupal 11/12 platforms, AI integration, performance engineering and multi-level data migrations.