Dealing with Template Cache
When updating your templates, you may experience issues with caching. Here's a guide on how to ensure this doesn't cause you any issues.
CDN
You may have a CDN handling either your static assets or sitting in front of your site and handling all traffic.
Try appending a parameter to the end of your URLs to validate if they appear differently, e.g. /templates/example.com/_images/my-image.jpg could be opened in your browser as the following /templates/example.com/_images/my-image.jpg?v=1. If this is different, it suggests that the initial image is cached.
Varnish
Varnish is a cache layer that caches pages to your customers. Sometimes you may see different results to your colleagues or customers - this will be down to Varnish being bypassed if you are logged into Aurora. After any template edits, you need to clear Varnish via Tools > Cache.
Product Listings page
The product listings page is powered by Elasticsearch, this includes all the Facets, search results and product data sets. This page is automatically regenerated when an item goes out of stock, or is edited in Aurora. In the majority of cases, it will be reset if an integration pulls in data, but this will depend on the initial requirements.
CSS/Javascript
If you've modified a CSS or Javascript file and used the available Aurora functionality noted in Including, Minifying and compressing Javascript and CSS, you should reset the cache after you've made any changes to these files. To do this, go into Tools > Cache and change the Resource Version, e.g. if it is "1" change it to "2".
Images
Aurora has a function called content_image_uri that you can use to link to any image in your templates directory. If you are looking at changing the images, you should change the Resource Version so the image URLs are changed.
If you change the Resource Versions, it will alter the URL of all images on the site. This should be carefully considered if you're using a CDN to host all of your assets, as they will need to recache them again.
Updated over 2 years ago