3

We currently use cache tags with a condition referencing the cache config setting:

{% cache for 1 hour if craft.config.cache %}

Is the condition necessary to stop HTML being inserted into the database cache?

David Oliver
  • 223
  • 1
  • 9

1 Answers1

3

No, there is a better way to do this. Set the enableTemplateCaching config value to false.

'enableTemplateCaching' => false,

With that setting disabled, all caching will be skipped.

// Won't be cached
{% cache for 1 hour %}
Lindsey D
  • 23,974
  • 5
  • 53
  • 110