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

Created on 8 November 2018, over 6 years ago
Updated 2 February 2023, about 2 years 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

10.1 ✨

Component
BigPipe  β†’

Last updated 8 days 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

Merge Requests

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 over 1 year ago
  • last update over 1 year ago
    30,341 pass
  • πŸ‡¬πŸ‡§United Kingdom catch

    Looks like #18 needs review.

  • Status changed to Needs work over 1 year 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 over 1 year ago
    30,060 pass
  • First commit to issue fork.
  • last update over 1 year ago
    30,146 pass
  • Pipeline finished with Failed
    6 months ago
    Total: 804s
    #323305
  • Pipeline finished with Failed
    30 days ago
    Total: 163s
    #450665
  • Pipeline finished with Success
    30 days ago
    Total: 426s
    #450668
  • Pipeline finished with Failed
    30 days ago
    Total: 156s
    #450727
  • Pipeline finished with Success
    29 days ago
    Total: 862s
    #450734
  • Status changed to Needs review 29 days ago
  • πŸ‡«πŸ‡·France prudloff Lille

    Writing a functional test seems hard without big_pipe_sessionless because core itself never uses the cache metadata from chunks.
    I added a unit test that checks if the chunks are cacheable.

  • The Needs Review Queue Bot β†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily 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.

  • Pipeline finished with Success
    26 days ago
    Total: 428s
    #454113
  • πŸ‡¬πŸ‡§United Kingdom catch

    Adding a couple of related issues, I'm not sure exactly how they would interact with this one yet.

    The main focus of those issues would be to enable big pipe for session-less users (in core, probably as a new configuration setting) but by pre-empting big pipe for cached placeholders, avoiding it entirely on warm caches (and hence the response would be cacheable by reverse proxies/page cache as usual).

  • πŸ‡«πŸ‡·France prudloff Lille
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Have not reviewed but issue summary appears to be missing.

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

    I updated the summary.

  • 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 necessarily 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.

  • Pipeline finished with Success
    21 days ago
    Total: 1435s
    #458226
  • πŸ‡«πŸ‡·France prudloff Lille

    The bot says the patch does not apply but I don't see any conflict on the MR.
    I rebased to see if it works better.

Production build 0.71.5 2024