Compatibility with Cache Control Override: is max-age=0 really necessary for BigPipe's placeholders?

Created on 8 November 2018, over 5 years ago
Updated 26 August 2023, 10 months ago

BigPipeSessionlessStrategy::doProcessPlaceholders() calls BigPipeStrategy::createBigPipeNoJsPlaceholder() which sets max-age to 0 in cache metadata. Thus, with the Cache Control Override module, any page containing a placeholder gives a "no-cache" Cache-Control header.

I don't really know how this problem could be fixed, but it would be nice to be able to have both long-lasting varnish-cached pages (big default page cache duration thanks to Cache Control Override) and still fast responses for uncached pages thanks to Big Pipe Sessionless.

Example use-case: on a public website, most of the pages don't change much (could be cached forever until an editor triggers invalidation), but there's an agenda page listing future events. As time goes by, the event list must be refreshed every day so that past events disappear.

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
BigPipeΒ  β†’

Last updated 1 day ago

Created by

πŸ‡«πŸ‡·France GaΓ«lG Lille, France

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Even though this is a test can we setup a test to check for the cache age?

  • πŸ‡«πŸ‡·France prudloff Lille

    The patch in #8 makes big_pipe responses cacheable when using big_pipe_sessionless and cache_control_override but it does not correctly bubble the cache tags from elements rendered by big_pipe.

    BigPipe::sendPlaceholders() calls sendChunk() with the chunk as a string.
    This means that sendChunk() never gets the cache tags and max age from these chunks.

    BigPipeSessionless::sendChunk() is able to use the chunk's cache parameters and apply them to the final cached page.
    If core does not send these cache parameters, cache tags from elements rendered by big_pipe will not bubble to the cached response.
    This means page cache can store a page even if it contains a block with max-age = 0 rendered by big_pipe; because its max-age will not bubble to the stored response.

    The attached patch makes core pass the chunk cache tags to big_pipe_sessionless.

  • Status changed to Needs review 10 months ago
  • last update 10 months ago
    30,341 pass
  • πŸ‡¬πŸ‡§United Kingdom catch

    Looks like #18 needs review.

  • Status changed to Needs work 10 months ago
  • The Needs Review Queue Bot β†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

  • First commit to issue fork.
  • last update 10 months ago
    30,060 pass
  • @rpayanm opened merge request.
  • First commit to issue fork.
  • last update 9 months ago
    30,146 pass
Production build 0.69.0 2024