I have a template element that is used on almost every page of the site. I would like to cache that element globally, except on one particular page I would like it to just be a normal cache based on the page URL.
The current code I'm using is below, which is not working as intended. The global cache is still working on entry id 126.
{% cache globally using key 'entry_' ~ entry.id ~ '_elements' unless entry is not defined or entry.id == '126' %}
What would be the best way to make that functionality work without slowing down any other pages? Thanks!
{% cache globally using key 'entry_' ~ entry.id ~ '_elements' unless entry.id == '126' %}