Change record status: 
Project: 
Introduced in branch: 
10.4.x, 11.1.x
Introduced in version: 
10.4.0, 11.1.0
Description: 

Dynamic Page Cache

Dynamic Page Cache already indicated and still indicates cache hits using X-Drupal-Dynamic-Cache: HIT and cache misses using X-Drupal-Dynamic-Cache: MISS. That does not change at all. So what does change?

Before
  1. X-Drupal-Dynamic-Cache: UNCACHEABLE
    
After
  1. Changed:
    X-Drupal-Dynamic-Cache: UNCACHEABLE (poor cacheability)
    

    when Dynamic Page Cache does not cache a response because the response has poor cacheability: it either has a low max-age (<=0 by default), a high-cardinality cache context (user or session by default) or a high-invalidation frequency cache tag (none of these by default). The definition of what constitutes "poor cacheability" depends on the renderer.config.auto_placeholder_conditions service container parameter (defined in core.services.yml), which can be overridden by sites.

  2. New:
    X-Drupal-Dynamic-Cache: UNCACHEABLE (no cacheability)
    

    if the controller returned a response object that is not an instance of \Drupal\Core\Cache\CacheableResponseInterface — because without cacheability metadata (tags, contexts, max-age), Dynamic Page Cache cannot correctly support caching.

  3. New:
    X-Drupal-Dynamic-Cache: UNCACHEABLE (request policy)
    

    if one the dynamic_page_cache_request_policy tagged services denies caching.

  4. New:
    X-Drupal-Dynamic-Cache: UNCACHEABLE (response policy)
    

    if one the dynamic_page_cache_response_policy tagged services denies caching.

Page Cache

Page Cache already indicated and still indicates cache hits using X-Drupal-Cache: HIT and cache misses using X-Drupal-Cache: MISS. That does not change at all. So what does change?

  1. New:
    X-Drupal-Cache: UNCACHEABLE (request policy)
    

    None of the request policy checks allowed this request to be cached.

  2. New:
    X-Drupal-Cache: UNCACHEABLE (response policy)
    

    if one the page_cache_response_policy tagged services denies caching.

Impacts: 
Module developers