Add support for lazy_builders and dynamic page cache

Created on 14 February 2018, over 6 years ago
Updated 2 July 2024, 2 months ago

We are currently starting a project where we plan on relying for dynamic page cache heavily. However from debugging how panels renders blocks, it seems it does not use lazy_builders, thus lacks support for dynamic page cache.

See \Drupal\block\BlockViewBuilder::viewMultiple() as reference of how core implements lazy builders.

Would be great to ensure blocks are rendered using lazy builders so dynamic page cache can apply its autoplaceholdering rules. https://www.drupal.org/docs/8/core/modules/dynamic-page-cache/overview β†’

πŸ“Œ Task
Status

Needs review

Version

4.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria fago Vienna

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

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

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.

  • πŸ‡¨πŸ‡¦Canada smulvih2 Canada 🍁

    Re-rolled the patch against the latest 4.8 tagged release. Also included changes from #2849867 πŸ“Œ Custom attributes in panels blocks and variants Fixed , by added the required changes to the new PanelsBlockViewBuilder::buildPreRenderableBlock().

    Tested the patch and seems to work as expected. On my search page based on panels, I now get two additional entries in the cache_render table for panel_block:

    -----------------------------------------------------------------------------------------------+------------+
    | cid                                                                                                                  | expire     |
    +--------------------------------------------------------------------------------------------------------+------------+
    | panels_block:29fd4183-c02c-4ac4-9d8e-8e99ed1bd57f:[languages:language_content]=en:[languages:language_interface]=en:[languages:language_url]=en:[route]=page_manager.page_view_search_search-panels_variant-035786c7EzDnDb5LJABAW5Gfv6h4fZJLlJps3jAE6d18HCRgQ_M |         -1 |
    | panels_block:29fd4183-c02c-4ac4-9d8e-8e99ed1bd57f:[languages:language_content]=en:[languages:language_interface]=en:[theme]=gcext_wxt:[url]=https://EXAMPLE.ca/en/search/site:[user.node_grants:view]=view.alOpv5-PurEF5Wj1lM1tRCLhW0OhmHwrTkZxw64Z6l4Uo                                              |         -1 |
    

    I also get two additional entries in the cache_dynamic_page_cache table with page_manager in the route:

    -------------------------------------------------------------------------------------------+--------+
    | cid                                                                                                 | expire |
    +-----------------------------------------------------------------------------------------+--------+
    | response:[languages]=en,en:[request_format]=html:[route]=page_manager.page_view_search_search-panels_variant-035786c7117b4e38d0f169239752ce71158266ae2f6e4aa230fbbb87bd699c0e3:[theme]=gcext_wxt:[url]=https://hcdev3_25TRRLA6Usnws7GjYEELUBQ3fVNz42kU0SRvdTV0I           |       -1 |
    | response:[request_format]=html:[route]=page_manager.page_view_search_search-panels_variant-035786c7117b4e38d0f169239752ce71158266ae2f6e4aa230fbbb87bd699c0e3                                                                                                    |            -1 |
  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    joseph.olstad β†’ made their first commit to this issue’s fork.

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    rolled patch #40 into MR25

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Patch #40 and MR 25 diff are identical.

  • Pipeline finished with Failed
    2 months ago
    Total: 249s
    #213458
Production build 0.71.5 2024