This module provides fine-grained control over Drupal's HTTP cache control headers, allowing you to configure cache lifetimes for various response types including errors and redirects, and to set advanced cache behaviors like stale-if-error and stale-while-revalidate. It also allows customization of the `Vary` header to cache content based on request headers.
HTTP Cache Control module helps fine grain control of Drupal's Cache Control headers.
Cache Features
- Support for shared cache max age (s-maxage)
- Support for Surrogate-Control (Fastly CDN) (2.x only)
- Ability to set cache lifetime of 404 pages
- Ability to set cache lifetime of 302 Redirects
- Ability to set cache lifetime of 500 level error pages (when in control by Drupal)
Revalidation Features
- Support for stale-if-error allowing cache proxies to server stale cache in place of an error from Drupal for a fixed period of time.
- Support for stale-while-revalidate allowing cache proxies to serve stale cache to other users while a cached item is being revalidated.
Variation
This module allows you to add arbitrary headers to the Vary response header to variate
upstream cache by the type of request headers sent.
Installation/Configuration
Simply download and install this module as per normal. Then go to the performance configuration page (admin > configuration > performance) and set the cache lifetimes accordingly.
Caution
This is an advanced module, care should be taken when fine tuning cache control headers. Please consider reading the HTTP spec on Cache Control headers: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Ask your assistant about HTTP Cache Control
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
- Dropsolid Rocketship Install Profile 88 sites
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 8.x-2.9 | Stable | 9–11 | Feb 6, 2026 | ||
| 8.x-2.8 | Stable | 9–11 | Jan 5, 2026 | ||
| 8.x-2.7 | Stable | 9–11 | Dec 30, 2025 | ||
| 8.x-2.6 | Stable | 9–11 | Feb 28, 2025 | ||
| 8.x-2.5 | Stable | 9–11 | Dec 27, 2024 | ||
| 8.x-2.4 | Stable | 9–11 | Dec 3, 2024 | ||
| 8.x-2.3 | Stable | 9–11 | Sep 19, 2024 | ||
| 8.x-2.2 | Stable | 9–11 | Aug 12, 2024 |