This module provides a framework for warming your site's cache after deployments and on a schedule to ensure optimal performance. It works by allowing other modules to define specific cache-warming tasks, such as pre-loading critical entities or clearing CDN caches, all performed asynchronously to avoid impacting users.
This module provides all the necessary infrastructure to orchestrate your cache warming processes.
You can warm the cache of your critical entities (and more!) right after you deploy to production. Additionally cron will keep them warm for you.
All these operations are executed asynchronously to avoid impacting the users.
📹 Watch the video tutorial 📹
@Warmer plugins
By itself the module does nothing. It needs other modules (contrib or custom) to provide @Warmer plugins. Each warmer plugin is in charge of warming a different type of items. You could have a warmer (a plugin) dedicated to the entity cache, another one for the JSON:API normalizations (via JSON:API Boost), another one that hits URLs to warm the CDN cache, etc.
A warmer plugin consists of:
- A settings form.
- A method to build a list of item IDs to warm. This works in batches to avoid overloading the system. Ex: entity ID, full URLs, …
- A method to trigger the warming operation. Ex: entity load, an external HTTP request, …
CDN Warmer
This module also provides a sub-module that includes a @Warmer for the page cache, Varnish, and edge cache, as it is a very common task. Warmer will make HTTP requests to the configured URLs to keep these caches warm.
Configure it with a list of URLs to keep warm. You can use any URL format like: entity:user/1, /node/1, https://example.org/foo, …
Alternatively, you can collect the URLs to warm from a Sitemap. Configure the warmer with the sitemap URL and (optionally) filter out the URLs with low priority.
Entity Warmer
This module also provides a sub-module that includes a @Warmer for the entity cache, as it is a very common task. This is a great example to develop your own warmers!
Schedule cache warming
You can manually enqueue the cache warming operations using the UI. Additionally hook_cron will schedule the cache warming with a configurable frequency.
Warm using Drush
One of the primary uses of this module is to warm your caches as part of the deployment script of your site. You can use Drush to do that.
List all the available warmers with the drush warmer:list command.
Then warm the caches by selecting the warmers to run:
drush warmer:enqueue entity,resource,custom --run-queue
Ask your assistant about Warmer
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
1 tracked project depends on this one
- JSON:API Boost 506 sites
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.0.14 | Stable | 10–11 | Oct 26, 2024 | ||
| 2.0.13 | Stable | 9–10 | PHP >=5.6.0 | Feb 19, 2024 | |
| 2.0.12 | Stable | 9–10 | PHP >=5.6.0 | Nov 6, 2023 | |
| 2.0.11 | Stable | 9–10 | PHP >=5.6.0 | Oct 31, 2023 | |
| 2.0.10 | Stable | 9–10 | PHP >=5.6.0 | Jun 29, 2023 | |
| 2.0.9 | Stable | 9–10 | PHP >=5.6.0 | Apr 28, 2023 |