Answers.Body: <p>You should give No-Cache a try: <a href="https://plugins.craftcms.com/nocache" rel="nofollow noreferrer">https://plugins.craftcms.com/nocache</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T10:55:02.323Z
Answers.LastActivityDate: 2020-09-11T10:55:02.323Z
Answers.UserDisplayName: Ottó Radics
Answers.Body: <p>No you can't, but you might be able to cache each block individually rather than trying to exclude one of them.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T08:59:47.233Z
Answers.Text: 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.
Answers.UserDisplayName: Martin Spain
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T07:12:51.820Z
Answers.LastActivityDate: 2020-09-11T07:12:51.820Z
Answers.UserDisplayName: darylknight
Body: <p>Does anybody know, if it is possible to prevent caching from within the cached code/content?</p>
  <p>Something like:</p>
  <pre><code>{% cache ... %}
  ...
  {% do notCache %}
  ...
  {% endcache %}
  </code></pre>
  <p>Why? Because if there is a content builder inside of the cache tag, certain content elements could simply disable caching that way by calling  <code>{% do notCache %}</code></p>
  
Tags: <cache>
Title: Prevent caching from inside of the cache tag
ThreadText: # Prevent caching from inside of the cache tag
  
  (Asked by: username_0 on 2020-09-11)
  
  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 %}`
  
  **Tags:** cache
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-09-11. Score: 2
  
  You should give No-Cache a try: <https://plugins.craftcms.com/nocache>
  
  
  ---
  
  ### Answer by username_2 on 2020-09-11. Score: 2
  
  No you can't, but you might be able to cache each block individually rather than trying to exclude one of them.
  
  > **Comments:**
  > **username_3**: 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.  
  
  ---
  
  