- ๐ต๐นPortugal introfini
In my case adding the cache context to $build had no effect.
I had to it in the $rendered_tree["#cache"]["contexts"][] = 'user';
- ๐ฎ๐ณIndia Raveen Kumar
Raveen Thakur โ made their first commit to this issueโs fork.
- ๐ฎ๐นItaly tanc Italy
If you add the user cache context then the rendered_tree cache will vary per user which might not be what you want. It pretty much makes the page uncacheable for logged in users.
- ๐ต๐นPortugal introfini
Unfortunately, that's really what I need, at least until the horrible idea of adding a block to the menu tree that varies by user is refactored.
Thanks for the alert!
- ๐ช๐ธSpain uridrupal
Once I added patch #14 it was also necessary to add:
/** * Implements hook_responsive_menu_off_canvas_tree_prebuild(). */ function mymodule_responsive_menu_off_canvas_tree_prebuild(array &$build) { $build['#cache']['contexts'][] = 'subsite_context'; }
After doing this, I had no more issues with cache.