Cache
The Aurora Cache is a system that caches pages, static content and assets from your Front-end to reduce load on the server and improve your Stores maximum load capacity.
This article describes how to use the Aurora View Cache and the features it offers.
Introduction
We are always improving the speed and performance of the system. One of the mechanisms we've used to achieve this is Varnish. This is a piece of software that dramatically improves performance and reduces loading times.
Issues with Caching on Test (non-production) sites?
This is very common indeed on test environments as when the site is not used over the night, caches expire or are cleared out due to the lack of use (or scheduled clearances). This means when you try to use it, the cache is cold and needs to warm up, which it does throughout the morning as you use it.
This being said, you should also consider the following:
- The varnish cache is not used if you are logged-in.
- On a live environment, requests keep the cache warm constantly.
- Some caches are only kept for 1 to 10 minutes and so if you use it quickly in a constant stream of requests, it might seem much faster than when you come back only a few minutes later and no-one else has been keeping the cache warm.
What is View Cache?
As lots of users request web pages on an Aurora site, Aurora often needs to produce identical responses. Despite often sending the same page, Aurora must recalculate a lot of the response from scratch each time a request like this is made. Though Aurora Commerce have taken significant care to make these requests as light and fast as possible, these requests always absorb some effort from the hosting infrastructure to generate, this is often one of the key bottlenecks that eventually slows down sites that experience high volume traffic. As Aurora sites become busy, caching ("saving") these identical responses being given to users means pages can be served again much more quickly whilst consuming far less additional resources.
Aurora has been carefully constructed with intelligent clearing policies to ensure that as these cached pages build up, they are also cleared again when administrators update their site content. Aurora's clearing code ensures customers are not seeing stale information and will often enjoy a much faster experience on the website in general.
Enabling View cache
To enable the view cache (built on top of Varnish) is not an easy task and does need considerable planning with Aurora Commerce, so it should only be considered for high traffic volume sites.
If your website does not have Varnish enabled, it will simply state "View Cache not enabled" and cannot be turned on.
If you would like to look into site performance please contact your Account Manager to discuss these options.
View Cache (Varnish) Settings
Once Varnish has been set up by Aurora Commerce, administrators are given a series of settings and tools to aid the use of the new cache layer.
Clearing Cache
Clearing cache shouldn't ordinarily be required, as Aurora has been equipped with carefully put together clearing policies which clears affected content from the website as the content is updated within Aurora. Administrators using queued cache clearing (see section below) may find it useful to trigger cache clearances that are not scheduled to be cleared for a period of time. Should administrators need to clear cache manually, a collection of tools has been made available in the following location:
Tools > Cache
Select the tab labelled: Clear View Cache
Within this page users have the following options:
- Clear Entire Cache - This allows administrators to clear all cached pages immediately.
- By URL - Provides a way to cherry pick URLs from the website and clear them individually.
- By Category - This allows administrators to select one or more categories to clear, this then clears all entries for the category including its associated product lists.
Note: Toggling between "Tick All Children" and "Tick Individual Categories" changes the way the tree of categories selects child categories of a selection.
If administrators are finding themselves clearing their cache regularly, please contact Aurora Commerce directly to determine whether the clearing policies are working well enough.
Delayed View Cache Clearing
Aurora has, by default, a relatively aggressive cache clearance policy as it seeks to clear cached content immediately as relevant data is updated. This approach ensures users of the website are generally seeing the most up to date content, however reduces the time cached items could stay active for without necessarily causing any negative consequences. Where content is being updated very regularly, significant performance gains can be made by queueing records for clearance at set intervals.
Note: Once users add something to their basket / login or do anything else that starts to personalise the site, they no longer get provided with cached pages ever, and instead enter a "Private Session".
Delayed Cache Clearing - Frequently Asked Questions
Q. "Does this mean users can order newly out of stock or newly in stock items from our website?"
No, after careful consideration, Aurora Commerce have chosen to introduce the idea of a "Private Session" so that users who populate their basket would bypass the cache layer altogether from that moment forwards. Once users have started a Private Session users only ever see the most current data.
Q. "What time period should I set the interval clearance to?"
The longer the interval the bigger the performance gain experienced in the website. Aurora Commerce don't recommend very large (longer than 24 hour) intervals as the catalogue will often become less and less accurate for users, particularly for high transaction volume and / or highly volatile sites. Each store will have its own set of needs and so if administrators are unsure how to go about setting this figure, please contact Aurora Commerce for guidance.
Delayed Cache Clearing - Settings
To activate delayed cache clearance in Aurora is relatively simple. Administrators must access:
Tools > Cache
and select the tab labelled: Cache Queue Settings
Here administrators are able to enable / disable queued clearance behaviour, and set the interval at which Aurora should be clearing stale cache items.
CSS/JS Caching
Aurora allows you to minify and compress all CSS and Javascript files into a single file, which will reduce the size of the page and the total assets that the browser has to download. More information can be found on this within the Including, Minifying and compressing Javascript and CSS page.
To enable this feature, simply click on "Compress Resources" and providing you are using the correct tags, it will kick in and compress all of your CSS/JS files. You will need to ensure that all of the files are created correctly, as minifying is very strict and can often result in errors if any of the individual Javascript files do not work.
Regardless of whether "Compress Resources" is enabled, Aurora allows you to append a variable to the end of every JS/CSS files, in order to ensure the browser does not cache it.
It is highly recommended that for any JS/CSS changes you make, that you increase the Resource Version by 1. So if it is currently 15, you should modify your CSS/JS files, make it 16 and save the page.
If Compress Resources is enabled, it will return a string similar to the below. Note the "33.css" at the end - this is the Resource Version.
If you do not have Compress Resources enabled, you would end up with something similar to this:
/templates/example.com/_css/bespoke.css?v=33
Simulate Compressed Resources
In order to simulate how the Store will look without applying Compress Resources, Aurora provides a tool that enables you to emulate the compressing of resources. The simulator also provides a debugger which lists possible errors and their causes.
This simulator is available in Store > View Cache
Enable Preview
Enable the Preview simulator.

Once enabled, it will open a preview for the current Store on the current page.
Select Domain
You may also have the option to select the domain to be previewed. This option will appear only if you have multiple domains.
Simulate Compressed Resources
Starts the process of simulating the Store with the Compressed Resources enabled
When checking out the "Simulate Compressed Resources", the list of errors will help to fix any css issue. After fixing them, it will be necessary to un-check and check this option again in order to allow the server to clear the cache and use the most up-to-date css files.
Reload Preview
Execute the Browser's Refresh for the preview. Use this button instead of Browser's Refresh in order to refresh the preview.
When the Simulate Compressed Resources option is enabled, it will provide a preview of the Store in the Preview tab. If the page layout/formatting is not correct, this is just a preview and it will not affect your live store. A list of possible errors for this is available in the Errors tab.
Updated over 2 years ago