Problem/Motivation

The module does not work as advertised if big_pipe module is enabled. This is due to the fact that bigpipe sets the max-age cachability paramter to 0 ($html_response->getCacheableMetadata()->setCacheMaxAge(0)). This prevents varnish from caching pages for logged in users.

Proposed resolution

  • This was not fixed in #3211614: Add support for BigPipe. (The changes in this issue made it a lot harder to understand the symptoms since it removed the requirements from the status page!)
  • The requirements should be clearly documented.
CommentFileSizeAuthor
#2 3370779-2.patch482 bytessokru
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

meanderix created an issue. See original summary.

sokru’s picture

StatusFileSize
new482 bytes

I noticed the following error on php logs each time a user tried to log in.

RuntimeException: Failed to start the session because headers have already been sent by "/var/www/html/vendor/symfony/http-foundation/Response.php" at line 426. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 132 of /var/www/html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php)
#0 /var/www/html/web/core/lib/Drupal/Core/Session/SessionManager.php(144): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#1 /var/www/html/web/core/lib/Drupal/Core/Session/SessionManager.php(109): Drupal\Core\Session\SessionManager->startNow()
#2 /var/www/html/vendor/symfony/http-foundation/Session/Session.php(59): Drupal\Core\Session\SessionManager->start()
#3 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(240): Symfony\Component\HttpFoundation\Session\Session->start()
#4 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(295): Drupal\big_pipe\Render\BigPipe->performPreSendTasks()
#5 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipeResponse.php(112): Drupal\big_pipe\Render\BigPipe->sendContent(Object(Drupal\big_pipe\Render\BigPipeResponse))
#6 /var/www/html/vendor/symfony/http-foundation/Response.php(423): Drupal\big_pipe\Render\BigPipeResponse->sendContent()
#7 /var/www/html/web/index.php(20): Symfony\Component\HttpFoundation\Response->send()
#8 {main}

I would say its due to Drupal core 9.2 changes that many other modules have faced. Attached a patch that fixes the error, but I still get the X-Cacheable:Cookie in the response header. Not sure if this still requires adjusting the default.vcl template.

shumer made their first commit to this issue’s fork.

shumer’s picture

BigPipe and Advanced Varnish are fundamentally incompatible: they solve the same problem (personalization on cached pages) with mutually exclusive approaches:

- BigPipe: streams the response in chunks (Transfer-Encoding: chunked), replacing placeholders lazily within a single HTTP response
- Advanced Varnish + ESI: Varnish buffers the entire response for caching, uses separate ESI subrequests for dynamic parts

Varnish cannot simultaneously buffer (required for caching/ESI) and stream (required for BigPipe). This is not a fixable bug, it's an architectural constraint. Initially I was hoping to fix that, but unfortunately that's not a case.

  • shumer committed 84c8d36f on 4.x
    feat: #3370779 Module incompatible with Bigpipe
    
shumer’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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