Allow s-maxage to be overridden

Created on 22 November 2023, about 1 year 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

Active

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.71.5 2024