Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Configuration Language Lock 1.0.2 Minor update available for module config_language_lock (1.0.2). Release: Canvas Override 1.0.1 Minor update available for module canvas_override (1.0.1). Release: Media Remote Image 8.x-1.2 Minor update available for module media_entity_remote_image (8.x-1.2). Release: IDNA Convert Service (punycode) 2.0.4 Minor update available for module idna (2.0.4). Release: Bootstrap Cloud 7.1.3 Minor update available for theme bootstrap_cloud (7.1.3). Release: synship 2.0.1 Minor update available for module synship (2.0.1). Release: Droost 2.0.0-alpha5 New alpha version released for module droost (2.0.0-alpha5). Release: FlowDrop 2.6.0-alpha2 New alpha version released for module flowdrop (2.6.0-alpha2). Usage Milestone: Term CSV Export Import Module term_csv_export_import crossed 1,000 active installs. Module Revived: Year/Month Widget 1.1.3 Module year_month_widget updated after 9 months of inactivity (1.1.3).

Purge Cache Warmer

No security coverage

Part of the Purge ecosystem · 14 projects

View on drupal.org

This module automatically reloads content into your cache after it's been invalidated. It makes an HTTP request to the site for each cache invalidation, ensuring a fresh copy is immediately available. It prioritizes warming pages that have been recently requested by visitors, rather than crawling the entire site.

Introduction

This module places updated versions of content that have been invalidated into internal and external caches, a process known as cache warming.

Explanation

As requests are made to the site, the URLs queuer module maintains a table mapping cache tags for the pages to URLs. Once content edits and updates trigger Drupal core's internal cache invalidation, the invalidations are registered by the URLs queuer module. URLs queuer then triggers external invalidations by URL for purgers that support it.

The Purge Cache Warmer module is a Purge purger plugin that is fired for each URL invalidation. It is intended to be executed after all other purgers have fired, and the caches are clear. For every URL invalidation invoked, the warmer makes an external HTTP request to the site. This ensures that for any page that is purged from cache a fresh copy is immediately reloaded into your caching architecture.

Because it works from the traffic registry that the URLs queuer maintains, it warms pages that real visitors have actually requested, rather than crawling the whole site.

Requirements

This module requires the following modules:

The 2.x series requires Drupal 11. Earlier releases declared core: 8.x and cannot be installed on Drupal 9 or later.

Configuration

  • Set up the Purge module (see instructions here).
  • Set up the URLs queuer module (see instructions here).
  • drush en purge_cache_warmer --yes
  • Head over to admin/config/development/performance/purge
  • Add Cache Warmer to the purgers.
  • Reorder the purgers so that Cache Warmer is last in the execution order.
  • To achieve accurate URL based cache invalidation, it is best to take a head start by training the traffic registry that the URLs queuer maintains: wget -r -nd --delete-after -l100 --spider https://example.com/

Recommendations

Since the module involves external calls back to the site, it is recommended to uninstall purge_processor_lateruntime and instead process purge invalidations using an external cron invoking Drush.

  • drush pm:uninstall purge_processor_lateruntime
  • drush p:processor-add drush_purge_queue_work
  • To process the queue, have your external cron invoke drush p:queue-work
  • Running at a one minute external cron is recommended.

Behavior worth knowing

  • TLS certificates are verified. If you warm an https origin using a self signed or internal CA certificate, that certificate has to be trusted by the web server.
  • Redirects are not followed. The invalidated URL is the one that needs warming, and the redirect response is itself what the cache should hold.
  • A URL that answers 404 counts as warmed, because the caches in front of Drupal then hold a current copy. Server errors, and 408, 425 and 429, are retried.
  • Requests use a 6 second timeout and a 2 second connect timeout. Purge rejects a time hint above 10 seconds and sizes its queue leases from it, so a page that needs longer than that to render will not be warmed.

Similar modules

Warmer also warms caches, but on cron over configurable entity and CDN queues, decoupled from invalidation. Use this module instead when you want warming tied directly to Purge's invalidation chain, so that exactly what was purged is warmed, in order, immediately after it is purged.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jul 2026
Latest release
1 month ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
2.0.0-beta1 Pre-release 11 Jul 29, 2026