BigPipeStrategy
class BigPipeStrategy implements PlaceholderStrategyInterface (View source)
Defines the BigPipe placeholder strategy, to send HTML in chunks.
First: the BigPipe placeholder strategy only activates if the current request is associated with a session. Without a session, it is assumed this response is not actually dynamic: if none of the placeholders show session-dependent information, then none of the placeholders are uncacheable or poorly cacheable, which means the Page Cache (for anonymous users) can deal with it. In other words: BigPipe works for all authenticated users and for anonymous users that have a session (typical example: a shopping cart).
(This is the default, and other modules can subclass this placeholder strategy to have different rules for enabling BigPipe.)
The BigPipe placeholder strategy actually consists of two substrategies, depending on whether the current session is in a browser with JavaScript enabled or not:
- with JavaScript enabled: #attached[big_pipe_js_placeholders]. Their replacements are streamed at the end of the page: chunk 1 is the entire page until the closing