1

Does anybody know, if it is possible to prevent caching from within the cached code/content?

Something like:

{% cache ... %}
...
{% do notCache %}
...
{% endcache %}

Why? Because if there is a content builder inside of the cache tag, certain content elements could simply disable caching that way by calling {% do notCache %}

2

No you can't, but you might be able to cache each block individually rather than trying to exclude one of them.

1
  • Agreed. Whenever I need to exclude a portion of code from within a cache tag, I tend to cache the component in chunks, appropriately named. Sep 11 '20 at 8:59
2

You should give No-Cache a try: https://plugins.craftcms.com/nocache

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.