Allow explicit bubbling of cacheability metadata inside Twig template (when accessing data from instead of rendering render arrays)

Created on 31 January 2016, almost 9 years ago
Updated 31 January 2024, 11 months ago

Problem/Motivation

Templates can include logic that requires cacheable metadata. Currently this can be done in preprocess why this is only normal task.

Proposed resolution

-

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Render 

Last updated 3 days ago

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • 🇳🇱Netherlands markwittens

    Any news about this issue? I just came across a website we've update to Drupal 10.1.8 where both workarounds from this issue are not working anymore:

    Workaround I always used:

      {% set _render_cache = content|render %}
    

    Alternative workaround:

      {{ { '#cache': content['#cache'] } }}
    

    The provided patches to add the twig function don't apply anymore.

    It seems the only way to render the proper cache tags is now to render the entire content variable.

Production build 0.71.5 2024