Answers.Body: <p>Not that creating an additional variable is that much effort, but since I only want to <strong>not</strong> cache if in <code>devMode</code>, I based my solution on Marion's utilizing the same <code>devMode</code> variable I'm using elsewhere. </p>
  
  <p><code>
  {% cache if not craft.config.devMode %}
  </code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-15T10:50:48.807Z
Answers.Text: For Craft 3 this need to be:
  {% cache if not craft.app.config.general.devMode %}
Answers.UserDisplayName: portnull
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-24T14:35:43.800Z
Answers.LastActivityDate: 2015-07-24T14:35:43.800Z
Answers.UserDisplayName: Ryan Shrum
Answers.Body: <p>It is true that devMode does not turn off caching. What I do is define a flag in general.php:</p>
  
  <pre><code>'cacheThings' =&gt; true, // true by default, but usually false for dev
  </code></pre>
  
  <p>and then in my templates:</p>
  
  <pre><code>{% cache if craft.config.cacheThings %}
  </code></pre>
  
  <p><strong>update</strong>
  Since version 2.4 there is a new config value: <a href="http://buildwithcraft.com/docs/config-settings#enableTemplateCaching" rel="nofollow">enableTemplateCaching</a>, so all you need to do now is set this <code>false</code> in your development environment.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-16T10:30:25.560Z
Answers.Text: This workaround is fine and it's good that devMode doesn't automatically disable the cache, but in my opinion there really should be a config setting for disabling the cache completely. I just added a feature request here: http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7588788-config-setting-for-cache-disabling
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-16T07:04:35.753Z
Answers.LastActivityDate: 2015-07-27T06:15:22.923Z
Answers.LastEditDate: 2015-07-27T06:15:22.923Z
Answers.UserDisplayName: Marion Newlevant
Body: <p>I'm trying to disable template caching in my development environment. I've tried a few things but thus far nothing has worked. I had thought that just setting devMode to true in the config would do the trick, but I'm still caching. The control panel shows the caution lines to indicate I'm in dev mode, but I still have to manually clear the cache before template changes show up. What am I overlooking?</p>
  
Tags: <cache>
Title: How to disable template caching? devMode isn't doing it
ThreadText: # How to disable template caching? devMode isn't doing it
  
  (Asked by: username_0 on 2015-04-16)
  
  I'm trying to disable template caching in my development environment. I've tried a few things but thus far nothing has worked. I had thought that just setting devMode to true in the config would do the trick, but I'm still caching. The control panel shows the caution lines to indicate I'm in dev mode, but I still have to manually clear the cache before template changes show up. What am I overlooking?
  
  **Tags:** cache
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-04-16. Score: 8 | Accepted answer
  
  It is true that devMode does not turn off caching. What I do is define a flag in general.php:
  
  ```
  'cacheThings' => true, // true by default, but usually false for dev
  
  ```
  
  and then in my templates:
  
  ```
  {% cache if craft.config.cacheThings %}
  
  ```
  
  **update**
  Since version 2.4 there is a new config value: [enableTemplateCaching](http://buildwithcraft.com/docs/config-settings#enableTemplateCaching), so all you need to do now is set this `false` in your development environment.
  
  > **Comments:**
  > **username_4**: This workaround is fine and it's good that devMode doesn't automatically disable the cache, but in my opinion there really should be a config setting for disabling the cache completely. I just added a feature request here: http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7588788-config-setting-for-cache-disabling  
  
  ---
  
  ### Answer by username_1 on 2015-07-24. Score: 5
  
  Not that creating an additional variable is that much effort, but since I only want to **not** cache if in `devMode`, I based my solution on username_3's utilizing the same `devMode` variable I'm using elsewhere.
  
  `{% cache if not craft.config.devMode %}`
  
  > **Comments:**
  > **username_2**: For Craft 3 this need to be: {% cache if not craft.app.config.general.devMode %}  
  
  ---
  
  