Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Advanced Page Expiration

Security covered Maintenance fixes only 2,727 sites

This module gives you advanced control over how long pages are cached by external services like Varnish or Fastly. You can set different expiration times for different pages, allowing certain content to be refreshed more frequently than others. It also offers options to exclude specific pages from caching altogether.

Advanced control of your cache-control header

Advanced Page Expiration addresses the use cases of needing certain pages on the site to expire faster than other pages when cached in an edge cache like Varnish or Fastly. For example, all pages on the site could be cached for 24 hours except for the homepage which could be cached for five minutes.

Advanced Page Expiration allows for better control of the Cache-Control header which cache services like Akamai and Varnish can use to determine cache length. Every site with an external caching server that recognizes the use of a cache-control header to set TTL for cached pages should consider this module.

In Drupal this is controlled by the poorly named "Expiration of cached pages" dropdown on the performance configuration page. What Drupal isn't clear about is that this dropdown sets a cache-control header for Drupal when it responds to a request. This header is what tells caching servers like Varnish how long the URL should be kept in the cache.

Note: The Drupal 7 release is still available but is no longer supported. If an additional maintainer would like to join to provide support for the D7 version let us know.

Cache control header options

  • Increased cache lengths - The maximum amount of time for a cached item is 1 Day. This module allows up to 1 Year.
  • Exclude pages from caching - A list of pages that should not be cached can be defined. This sets the cache control header to no-cache.
  • Rules Integration - Using Rules more complex conditions beyond just path could be created to set the cache-control header. This is currently only supported for Drupal 7.x.
  • hook_ape_cache_expiration_alter() - This hook will allow complex custom logic to determine the cache expiration length.

Finally, just to be clear, this module only applies to external page caching, not Drupal's internal page cache.

Drupal 9–11

Ask your assistant about Advanced Page Expiration

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
1
Tracked since
Sep 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
8.x-1.6 Stable 9–11 Sep 19, 2023