Problem/Motivation
#2478483: Introduce placeholders (#lazy_builder) to replace #post_render_cache introduced the concept of "placeholders". It allowed us to remove #post_render_cache, and all the special handling for that, and just have placeholders be another type of attachment. So, we now have #attached[placeholders].
Because placeholders are an attachment, they should be handled in a HtmlResponseAttachmentsProcessor, which specifically is the place that takes attachments and ensures the HtmlResponse is updated accordingly.
(This issue & code originate from #2429617: Make D8 2x as fast: SmartCache: context-dependent page caching (for *all* users!). This blocks that issue, as well as #2349011: Implement placeholder based-rendering strategies to support SingleFlush, BigPipe, ESI….)
Proposed resolution
Make it so.
Remaining tasks
Review.
User interface changes
None.
API changes
None.
But, notable change:HtmlResponseAttachmentsProcessor now renders the attached placeholders (#attached[placeholders]). Which means finally all attachments are truly processed in the AttachmentsResponseProcessorInterface implementation for HTML responses.
This means HtmlRenderer no longer needs to render attached placeholders. Which means HtmlResponse objects are now perfectly cacheable, because they don't contain anything user-specific.
(This is not an API change, just an implementation detail change.)
Data model changes
None.
Beta phase evaluation
| Issue category | Task because not broken, but an important improvement. |
|---|---|
| Issue priority | Major because it blocks significant other issues. |
| Prioritized changes | The main goal of this issue is performance/cacheability. |
| Disruption | Zero disruption. |