Problem/Motivation
Currently if a response is not cacheable Drupal sets X-Drupal-Dynamic-Cache = UNCACHEABLE, but in some cases it does not. See DynamicPageCacheSubscriber::onResponse for details.
Steps to reproduce
NA
Proposed resolution
Always set X-Drupal-Dynamic-Cache
header.
- This changes the existing
X-Drupal-Dynamic-Cache: UNCACHEABLE
toX-Drupal-Dynamic-Cache: UNCACHEABLE (poor cacheability)
. - This adds
X-Drupal-Dynamic-Cache: UNCACHEABLE (no cacheability)
(for responses which aren't instances ofCacheableResponseInterface
). - This adds
X-Drupal-Dynamic-Cache: UNCACHEABLE (policy)
(when the Dynamic Page Cache request/response policy tagged services deny caching).
This makes it much easier for developers to understand what the Dynamic Page Cache module is doing, and why.
Remaining tasks
Review
User interface changes
NA
API changes
NA
Data model changes
Don't think so
Release notes snippet
Page Cache & Dynamic Page Cache response headers improved to include more detail about the cacheability. See change record.