Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Leaflet 10.4.13 — Minor update available for module leaflet (10.4.13). Release: Flag 5.1.1 — Minor update available for module flag (5.1.1). Release: Layout Paragraphs 3.0.0-beta5 — New beta version released for module layout_paragraphs (3.0.0-beta5). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Cloudflare Purger

40 sites Security covered Drupal 10–11

Part of the Cloudflare ecosystem · 19 projects

View on drupal.org

This module integrates with the Purge module to invalidate Cloudflare CDN caches. It adds a 'Cache-Tag' header to Drupal responses, allowing Cloudflare to track and purge content based on Drupal's cache tags using the Cloudflare API.

This module adds Cloudflare CDN cache invalidation support by integrating with the Purge module.

Features

Integrates with the Purge module to do the following:

  • Adds a "Cache-Tag" HTTP response header to all of Drupal's cacheable responses. The value of the header is a hashed list of all the Drupal cache tags for that response. Cloudflare stores these cache tags along with the cache data for later lookup.
  • Uses the Cloudflare API to send a purge-by-tags request to Cloudflare when Drupal invalidates one or more cache tags.

Post-Installation

Dealing with hosting environment response header limitations

This module adds a "Cache-Tag" HTTP response header which may be very large on pages with many cache tags. Some web servers have strict limits on the size of HTTP response headers. Exceeding this limit can cause errors.

To protect from this scenario, this module exposes a container parameter, cloudflare_purger.max_response_header_length. If the Cache-Tag header for a response exceeds this value, the header is not set and the entire response is marked uncacheable by the Cloudflare CDN using the Cloudflare-CDN-Cache-Control header. (Note - other caching layers may continue to cache the response!). Marking it uncacheable in Cloudflare is critical to prevent the page from being cached indefinitely as it won't have any of the cache tag metadata needed to support invalidations.

Example customization

Cloudflare supports individual response header sizes up to 16kB, but the Acquia hosting environment only supports header sizes of 8kB. In order to safely use this module with Acquia hosting, use this configuration in your services.yml file:

  parameters:
    # 8192 - strlen("Cache-Tag: ") = 8181
    cloudflare_purger.max_response_header_length: 8181

This ensures that the the Cache Tag header size remains compliant with both Acquia's origin servers and Cloudflare.

Preventing hash collisions if environments share a common zone

If multiple environments (dev / test / prod, for example) share a common Cloudflare zone and also share a common hash_salt setting, that would risk cross-environment cache purging. For such configurations this module supports a setting, cloudflare_purger_cache_tag_prefix, which can be used to override the cache tag prefix that is used to help ensure uniqueness of cache tags. By using this setting, each environment (dev / test / prod) can have its own unique cache tag prefix set, thus ensuring that cache purges do not break environment isolation.

Example custom prefixes (Acquia Hosting)

Say there are three environments: dev, test, and prod. There is also an environment variable that denotes which environment is which. By adding this to settings.php, each would have its own unique prefix.

  if (isset($_ENV['AH_SITE_GROUP'], $_ENV['AH_SITE_ENVIRONMENT'])) {
    $settings['cloudflare_purger_cache_tag_prefix'] = $_ENV['AH_SITE_GROUP'] . '.' . $_ENV['AH_SITE_ENVIRONMENT'];
  }

API Token Best Practices

As a general rule, limit the token permissions to only include the bare minimum. In the case of this module, only the Purge permission for a particular Zone is required.

Hosts with fixed outbound IP addresses

To further harden the token, always include the outbound IP address(es) of the origin server(s) in the Client IP Address Filtering section. This option will ensure that only the origin server(s) are able to use the token, so even in the event of a token compromise, it cannot be used by bad actors.

Additional Requirements

The Purge and Key modules are required.

Similar projects

The Cloudflare module has a cloudflare_purge sub-module, however this is not compatible with Cloudflare's header and account limits in 2026 and duplicates some functionality from the purger module.

Cloudflare purge is a completely standalone implementation that does not integrate with the Purge module.

Supporting this Module

To come...

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

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

Release Timeline

Releases

Version Type Core Release date
1.0.0 Stable 10–11 Aug 19, 2026
1.0.0-beta3 Pre-release 10–11 Aug 6, 2026
1.0.0-beta2 Pre-release 10–11 Jul 28, 2026
1.0.0-beta1 Pre-release 11 Jul 13, 2026
1.0.x-dev Dev 10–11 Jul 2, 2026