Allow s-maxage to be overridden

Created on 22 November 2023, 7 months ago
Updated 26 April 2024, about 2 months ago

Problem/Motivation

If a controller response is setting s-maxage, that value should be respected over the global value.

Steps to reproduce

Set s-maxage in a custom Controller response that is a value other than what's set by this module, and see this module's global value is what is used.

    $response = new CacheableJsonResponse($response);
    $response->headers->set('Cache-Control', 's-maxage=900');
    return $response;

Proposed resolution

Check if this header is set, and only add this module's value if it is not.

🐛 Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

🇺🇸United States joecorall

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024