Link Search Menu Expand Document


The cache_tag accepts an array of drops or keys as an argument which will be used to cache the entire contents of the tag. The cache tag assigns a unique key to avoid conflicts between blocks with identical params.

{% cache variant %}
{% endcache %}


The cache clears every 30 minutes by default and refreshes on the next page load. A custom expiry time can be set by passing in an expires_in argument and the time in seconds.

The following example sets an expiry time of 5 minutes: expires_in: 300.

{% cache variant, variant.product, expires_in: 300 %}
   {{ }}
   {{ variant.min_price }}
 {% endcache %}

Cache keys

Any number of variables can be passed into the cache as keys. A change to one of these keys will invalidate the cache regardless of when the next expiry is due.