Problem/Motivation

Setting the http.response.debug_cacheability_headers container parameter to TRUE is very helpful to debug cacheability issues.

While it's not a good idea to do this in production there is no harm in enabling this by default on development environments.

Proposed resolution

Add the following to development.services.yml:

http.response.debug_cacheability_headers: true

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#6 add-2827047-6.patch485 bytesfaline
#5 add-2827047-5.patch487 bytesfaline
#3 add-2827047-3.patch343 bytesfaline

Comments

tstoeckler created an issue. See original summary.

dawehner’s picture

Good idea!

faline’s picture

Status: Active » Needs review
StatusFileSize
new343 bytes

Including parameter http.response.debug_cacheability_headers as true for development environments as the proposed resolution by @tstoeckler

tstoeckler’s picture

Generally, we put the parameters before the services in services YAML files, not sure how much people care about this.

faline’s picture

StatusFileSize
new487 bytes

@tstoeckler you are right, I just realize that after uploading. =) I just generated a new one

faline’s picture

StatusFileSize
new485 bytes

ops, removing extra line in the end of file

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, thanks!

The last submitted patch, 3: add-2827047-3.patch, failed testing.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 37db2b5 to 8.3.x and bddce2c to 8.2.x. Thanks!

  • alexpott committed 37db2b5 on 8.3.x
    Issue #2827047 by faline, tstoeckler: Add http.response....

  • alexpott committed bddce2c on 8.2.x
    Issue #2827047 by faline, tstoeckler: Add http.response....
alexpott’s picture

I committed this to 8.2.x as it is a DX improvement with no run-time impact. In fact this file should almost be viewed as documentation.

wim leers’s picture

Can you next time please comment on the associated issue, to get reviewers who followed that issue?

Big +1 of course!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mxh’s picture

After upgrading from 8.1 to 8.2, I got the following error in my Apache error_log:

[core:error] Premature end of script headers: index.php

..using Dev Desktop ver. 2 with mod_fastcgid (FastCGI) as development environment. The reason behind is that the cachetags exceed the given limit of the header size.

Setting http.response.debug_cacheability_headers to false in development.services.yml "fixes" the problem for me.

Alternative / better solution might be raising the header field limit in the Apache/FastCGI configuration.

mpotter’s picture

Thanks to the post in #15 for this. It is actually very common on complex sites to exceed the Apache header size with too many cache tags, especially when logged in as a user looking at a listing page with lots of nodes that are cached per-user because of node-history.

Not sure why it was decided making this the default was good. It causes a white-screen crash in Apache that is difficult to debug.

@alexpott wonder why in #12 this was considered "no impact". Is there some other way we should be limiting the size of the cache headers? Or what am I losing by having this False.

hanoii’s picture

Geez, I finally got here after finding that http.response.debug_cacheability_headers fixes the error as stated on #15.

I second this was super hard to find. I was close to just call it a day and install nginx just for the one project where this happened to me. It's not so big though, it's actually pretty simple.

hanoii’s picture

josephdpurcell’s picture

I ran into this issue and will comment on #2954339.

anybody’s picture

Final issue for this topic: #2844620: Automatically split cache debug headers into multiple lines when they exceed 8k
Just ran into this issue again with http.response.debug_cacheability_headers: true!