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.
Project information
Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Performance
2,595 sites report using this module
- Created by steel-track on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Add Drupal 10 support
Development version: 8.x-1.x-dev updated 19 Sep 2023 at 14:59 UTC


