Skip to content

Commit

Permalink
use the filter when sending cache control headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed May 15, 2024
1 parent 023714b commit 63f4c1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inc/pantheon-page-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ public function view_settings_page() {
*/
private function get_cache_control_header_value() {
if ( ! is_admin() && ! is_user_logged_in() ) {
$ttl = absint( $this->options['default_ttl'] );
// Use the filtered default max-age if applicable.
$ttl = apply_filters( 'pantheon_cache_default_max_age' , absint( $this->options['default_ttl'] ) );
if ( $ttl < 60 && isset( $_ENV['PANTHEON_ENVIRONMENT'] ) && 'live' === $_ENV['PANTHEON_ENVIRONMENT'] ) {
$ttl = 60;
}
Expand Down

0 comments on commit 63f4c1a

Please sign in to comment.