Use page_cache_maximum_age variable instead of custom fastly_ttl

Created on 26 May 2015, over 9 years ago
Updated 12 July 2023, over 1 year ago

Problem/Motivation

Currently, this module uses a custom fastly_ttl variable to for the cache-control headers (well actually, for Surrogate-Control headers)
If we were to use the page_cache_maximum_age variable instead, which is defined in Drupal core, it would allow other modules to adjust the ttl. (You can set this variable by going to admin/config/development/performance and changing the value for "Expiration of cached pages").

This does mean we lose the ability to set the TTL from within Fastly. As currently this is grabbed through the Fastly API, and sort-of synced with the fastly_ttl variable. But I'm not too convinced about how this is done, and I don't think this is actually useful. You would only want to set the TTL through Fastly if you weren't able to set the appropriate headers from your application, and in our case we do!

Proposed resolution

Remove the fastly_ttl variable and use page_cache_maximum_age instead.

Remaining tasks

  • Set the Surrogate-Control headers to use the page_cache_maximum_age variable.
  • Remove the TTL option from the Fastly configuration page.
  • Add some help text on the Fastly config page to let the users know where to set the TTL.
  • Add an update hook to delete the variable.
  • Also set the page_cache_maximum_age variable with the old value from fastly_ttl in the update hook

User interface changes

Removal of TTL option on Faslty config page, instructions to edit this on the admin/config/development/performance page.

API changes

None

Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom Leon Kessler

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024