Change record status: 
Project: 
Introduced in branch: 
11.4.x
Introduced in version: 
11.4.0
Description: 

Previously the value of the X-Drupal-Dynamic-Cache response header for 4xx and 5xx responses was misinforming developers: if the 4xx or 5xx response was generated early enough, the response would state X-Drupal-Dynamic-Cache: UNCACHEABLE (poor cacheability), even though cacheability played no role. It was uncacheable because the response was generated so early.

This has now been fixed so that 4xx and 5xx responses always return UNCACHEABLE (XXX) as the value of the X-Drupal-Dynamic-Cache response header where XXX is the actual response status code (so in particular UNCACHEABLE (403) or UNACHEABLE (404), for example).

For "regular" 4xx requests (i.e. for GET requests with HTML content type), Drupal internally performs a sub-request to return the (in the case of a 404, for example) "not found" page. In case that happens, the cache status of that sub-request is also returned as part of the value of the X-Drupal-Dynamic-Cache response header. The value is then UNCACHEABLE (403, sub-request: MISS) or UNCACHEABLE (404, sub-request: HIT), for example.

Impacts: 
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers