- Issue created by @brockfanning
When using drupal_block() to render the Drupal core language block, some caching issues are caused. At least, processed text formats re-process on every page load.
Create a content type with a formatted text field.
Use a text format that uses some input filters, like the HTML tag filter.
Create a new node of this type and view it.
Use logging or debugging to confirm that the input filter only processes on the first load, and thereafter it is cached.
Create a custom template in your theme for this content type.
Enable twig_tweak and the language module.
In the custom template, somewhere add: {{ drupal_block('language_block:language_interface', wrapper=false) }}
View that same node again, refreshing multiple times
Observe that every time you refresh, the input filter processes the text
There is a lot of discussion related to this in: https://www.drupal.org/project/drupal/issues/2232375 π Make language switcher block cacheable Postponed
I don't know enough to make any recommendations, and was advised in that issue to create this issue. In the meantime our plan is to use the regular block layout system instead of twig_tweak, for the language block.
Active
3.4
Code