Simple CloudFront invalidation
This module automatically invalidates your entire AWS CloudFront cache whenever Drupal content changes, making it suitable for smaller websites that need a simple setup. It assumes your AWS credentials are provided through environment variables or the AWS Metadata Service.
NOTE: AWS CloudFront supports cache based invalidation since April 2026, so I recommend people use the standard purger module with the cloudfront_purger:^2.2 module. This module no longer serves a purpose
About
Module to invalidate the CloudFront cache when Drupal content changes. Suitable for small sites.
How it works
Stand-alone module for CloudFront cache invalidation: as soon as Drupal wants to invalidate the cache, immediately invalidate the entire CloudFront cache. The goal is ease of setup.
Configuration
You cannot provide AWS credentials in this module, we assume your setup has access to credentials either via the AWS Metadata Service or via environment variables.
You usually would set your distribution id in your settings.php like:
$config['cloudfront_invalidate_all.settings']['distribution_id'] = getenv('DISTRIBUTION_ID');
So it is injected via an environment variable. Or you can hard-code it, or save it to config.
Black lists
Many cache invalidation tags are irrelevant and should not clear CloudFront. There's a preconfigured comprehensive black list installed, and this can be changed in the settings form.
Why not use the purge module?
The purge module is very complicated and requires many more bits. Out of the box it does not work for with CloudFront. You can install the CloudFront purger but that will also not help you. The URL queuer addition does not work properly.
So you are left with having to write mappings from Drush cache tags to paths yourself. For smaller sites you don't really need that.
Does this work for large sites?
No. Small sites, thousands of urls are fine. For large sites you want the purge module and write custom code to map cache invalidation tags to CloudFront paths.
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
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.2.0 | Stable | 10–11 | Dec 16, 2025 | ||
| 1.1.2 | Stable | 10–11 | Install module in disabled state else it might invalidate for no good reason yet | Sep 26, 2025 | |
| 1.1.1 | Stable | 10–11 | Sep 26, 2025 | ||
| 1.1.0 | Stable | 10–11 | Switch to using a whitelist instead of blacklist for cache tags | Jul 25, 2025 | |
| 1.0.0 | Stable | 10–11 | First public release | Jul 23, 2025 | |
| 1.0.x-dev | Dev | 10–11 | Testing | Jul 22, 2025 |