Problem/Motivation
As part of the system.performance
config, Drupal currently includes the cache.page.max_age
property that provides the max-age value in Cache-Control header on cacheable responses. There are many scenarios where it is desirable to have an independent max-age for 4xx responses.
Proposed resolution
In addition to invalidating the Drupal cache ( #2472281: 404/403 responses for non-existing nodes are cached in Page Cache/reverse proxy, are not invalidated when the node is created), make the emitted max-age for 4xx responses independent of the standard max-age.
This new property should still be part of the system.performance
and named cache.page.4xx_max_age
and be nullable
. The value of this new property should be set to null
initially and fallback to the standard cache.page.max_age
if not set.
Remaining tasks
Create change record. Stub: #2972025
User interface changes
No changes (per discussion in comments below).
API changes
New config to provide the max-age value in Cache-Control header on 4xx responses.
Discovered by pwolanin & klausi.