debug_cacheability_headers are not showing

Created on 15 November 2017, over 7 years ago
Updated 29 May 2023, about 2 years ago

According to https://www.drupal.org/docs/8/api/responses/cacheableresponseinterface#d ..., changing "http.response.debug_cacheability_headers" to true will show two new cache headers in drupal pages, but it's not.

I can never see the two headers as described at https://www.drupal.org/node/2222835 .

     $c = \Drupal::getContainer();
     $p = $c->getParameter('http.response.debug_cacheability_headers');
     var_dump($p);

$p shows boolean true, but the two headers are not showing.

🐛 Bug report
Status

Closed: cannot reproduce

Version

9.5

Component
Cache 

Last updated 12 days ago

Created by

🇨🇳China smiletrl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇹🇼Taiwan g-brodiei

    Trying to reproduce with the following steps, but the issue described did not show.

    1. Installed Drupal version: 10.0.9 locally
    2. Copy example.settings.local.php to /sites/default/settings.local.php
    3. Uncomment last paragraph to in settings.php to take settings.local.php to override
    4. Check development.services.yml has the following http.response.debug_cacheability_headers: true under parameter section.
    5. Clear cache
    6. Open site homepage and chrome devtools
    7. Navigate to Network tab on devtools and click on the homepage link shown in image
    8. See response headers for X-Drupal-Cache-Contexts, X-Drupal-Cache-Max-Age, X-Drupal-Cache-Tags, X-Drupal-Dynamic-Cache
    9. The Response Headers show as expected, can't reproduce
Production build 0.71.5 2024