Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Cache Control Override

Security covered Under active development 7,865 sites

This module allows you to set different cache expiration times for individual pages, overriding the global page cache settings. It uses Drupal's cacheability metadata to dynamically adjust the Cache-Control max-age header, which is useful for reverse proxies that respect these settings.

In Drupal 8 core Page Cache max age settings are applied globally to all pages, and there is no way to set a different max age per page or leverage cache metadata max-age to override Cache-Control max-age value. This means that if you're hosting your website behind a reverse proxy that honors Cache-Control header, all pages are cached with equal TTL. You can either disable cache with response policies, or cache it for the same global value.

This module is intended to solve that problem by leveraging cacheability metadata bubbled up to the page response level to override Cache-Control max-age parameter.

Installation
1. Enable the module
2. Profit, it just works, no configuration needed

Why this is not resolved in Drupal Core?
This could end up in core soon, but adding it in core now might break backwards compatibility. The work is done in those 2 issues:
https://www.drupal.org/node/2352009
https://www.drupal.org/node/2499321
Basically when those end up in core, this module will become obsolete unless it can find a different problem space

Roadmap:
There are no plans yet to extend the configurability of the module in other ways, but suggestions are welcome in issue queue!

Versions and compatibility

  • 8.x-1.0 is compatible with Drupal 8 and 9.
  • 8.x-1.1 is compatible with Drupal 9. Drupal 8 is no longer supported by the project.
  • 8.x-1.x is not compatible with Drupal 10 or above.
  • 2.x is compatible with Drupal 10 and above. The branch is feature and config compatible with 8.x-1.x and is thusly a drop-in replacement.
Drupal 10–11 PHP 8.2

Ask your assistant about Cache Control Override

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

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Sep 2023
Latest release
2 weeks ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.2.0-rc1 Pre-release 11 PHP 8.5 Nov 3, 2026
2.1.0 Stable 10–11 PHP 8.2 Nov 3, 2026
2.x-dev Dev 10–11 PHP 8.2 Nov 3, 2026
2.0.1 Stable 10–11 PHP 8.1 Aug 21, 2024
2.0.0 Stable 10–11 PHP 8.1 Sep 21, 2023