Better control over cached objects in Drupal 7 can be achieved by installing the following modules:
The Acquia Purge and Cache Expiration modules combine to create a cache invalidation approach for objects cached in Acquia Varnish.
Note: Static assets such as CSS fonts, images and Javascript files are given Cache-Control headers by the Apache web server, and are cached for 2 weeks by default.
If you are a Platform CDN user, you may want broader control over objects cached in the CDN. Install the Chaos Tools Suite and HTTP Response Headers modules.
If you are manually installing these modules copy them into the contrib folder like so:
~/dev/d7cdnsandbox/docroot/sites/all/modules/contrib>tree -d -L 1
.
├── acquia_purge
├── ctools
├── expire
└── http_response_headers
Once you have installed the modules, open your site and visit admin/modules. Complete the installation and configuration of the Acquia Purge and Cache Expiration modules by following these instructions: Installing Acquia Purge and Expires modules on D7, Configuring Acquia Purge on D7, and the corresponding FAQ Page.
To configure HTTP Response Headers, visit the Chaos Tools Suite section, and enable 'Chaos Tools'. In the Other section, enable 'HTTP Response Headers' and 'HTTP Response Headers UI'.
Next, navigate to admin/config/system/http-response-headers:
The Cache-Control header sets the following directives in Acquia Varnish:
The long Time-To-Live (TTL) at Acquia Varnish (1209600 seconds) is desirable because most cached paths at Acquia Varnish are expired by the Acquia Purge and Cache Expiration modules whenever content changes. The shorter TTL at the browser (60) is desirable because your application has no way to purge the browser cache.
Now repeat the steps above to set the Surrogate Control header:
This will set the Surrogate-Control header for dynamic content to: `Surrogate-Control: max-age=180`. This header instructs Platform CDN to cache objects for three minutes (180 seconds). This short cache lifetime is desirable because D7 has no way to purge individual paths from Platform CDN, so setting a low TTL at the edge ensures that the oldest age of any cached object will be, at most, three minutes.
Note: When testing, you may want to set the Surrogate-Control header to a very low value (1-5 seconds). The CDN strips the Surrogate-Control header on arrival, so you will never see the header in a curl response. Instead, set a low TTL, then test by changing content on a page, clearing your browser cache and visiting the page in an anonymous seion (i.e., a Chrome incognito browser session). After your tests are complete, change the Surrogate-Control: max-age directive to as high a TTL as tolerable.
You may need to purge all caches if you want these changes to take effect immediately rather than waiting for the current cached pages to expire.
For information about how the Drupal application sets cache headers see these articles:
https://www.drupal.org/docs/8/api/responses/cacheableresponseinterface#debugging
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Wed Oct 22 2025 09:07:31 GMT+0000 (Coordinated Universal Time)