HTTP 502 caused by too long X-Drupal-Cache-Tags header value

Created on 8 March 2022, almost 3 years ago
Updated 25 April 2024, 8 months ago

Problem/Motivation

Too long X-Drupal-Cache-Tags headers (with 700+ cache tags) can cause HTTP 502 error with the following default configurations:

fastcgi_buffers: 16 32k
fastcgi_buffer_size: 32k

The usual result is:
upstream sent too big header while reading response header from upstream

The usual recommendation is tweaking the webserver configuration but based on my experience that is also not enough. Even if the HTTP 502 error goes away, the above mention header value remains empty:

Steps to reproduce

Forms currently are not render-cacheable πŸ“Œ Form tokens are now rendered lazily, allow forms to opt in to be cacheable Needs review , but if you add an entity reference list like form element to a form that lists large amount entity labels and bubbles up cacheability information, the same can happen.

Proposed resolution

Generate more than one X-Drupal-Cache-Tags header when the number of cache tags exceeds a limit.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

9.4

Component
BaseΒ  β†’

Last updated 1 day ago

Created by

πŸ‡­πŸ‡ΊHungary mxr576 Hungary

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.

  • πŸ‡«πŸ‡·France O'Briat Nantes

    For the record, it also triggers a 503 on Varnish, to detect it use the option -g session with varnishlog . It should returns (after a slight wait) the following error:

    ...
    --- VCL_return     fetch
    ...
    --- BogoHeader     Header too long: Cache-Tags: config:b
    ...
    
Production build 0.71.5 2024