Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

HTTP Cache Control

8,248 sites Security covered
View on drupal.org

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

Activity

Total releases
3
First release
Dec 2025
Latest release
5 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
8.x-2.9 Stable Feb 6, 2026
8.x-2.8 Stable Jan 5, 2026
8.x-2.7 Stable Dec 30, 2025