© 2021 Ezoic Inc.
What is a cache hit?
A cache 'hit' occurs when a user request for your content is fulfilled by the closest edge server rather than the origin server. In contrast, a cache 'miss' occurs when a similar request cannot be fulfilled by the closest edge server, meaning that the request has to travel all the way to the origin server and back again.
Why is this important?
Take a look at the below image. Note that the average host response time for a cache hit is just 7.52ms (milliseconds) compared to 715.12ms for a cache miss, a difference of 707.6ms. What this means is that when a user's request for this site content is fulfilled by the origin server rather than the closest edge server (a cache 'miss'), it takes nearly a second longer on average for this content to be returned to Ezoic by the host than if it were to be fulfilled by the closest edge server instead (a cache 'hit'). As you can see, this has a knock-on effect on both time to first byte and time to interactive, as well as engagement.
A high cache hit rate combined with Ezoic’s free site speed features will help to ensure fast speeds and good Core Web Vitals for most sites.
Okay, and the cache hit rate?
This is expressed as a percentage, and is calculated by taking the number of cache hits and dividing it by the number of cache hits and misses combined.
For instance, where Ezoic's CDN returns 95 cache hits and 5 cache misses, the cache hit rate would be 95%.
Where can I view my cache hit rate?
You are able to view your cache hit rate by navigating to the Analytics tab in your dashboard and scrolling to the Site Speed section in the left column. From there, you can select Caching> Ezoic caching, and you'll see the cache 'hit' and 'miss' percentage data.
How can I improve my cache hit rate?
Outlined below are some steps that can be taken to improve your cache hit rate if you're seeing a high amount of cache misses for your site.
1) Increase the cache age
When you enable the caching app, it will automatically respect whatever 'maximum cache age' headers you have set up on the origin server end. However, if there is no maximum age specified in the cache headers, we will set a default 24 hour caching age (86400). This means that your pages will be stored in our CDN for 24 hours before they are updated. You are able to increase the cache age so that your pages are stored for longer before they are updated. If your cache hit rate is low, increasing the cache age to 2 or 3 days you could improve this. Editing the cache age can be achieved by clicking “Update Cache Settings Values” and setting the number of seconds under Default Cache Age (we have a minimum of 36000 seconds = 1 hour that must be set). Once edited, this can be saved by clicking “Update Domain Setting Values:
* Please note that if your content is regularly updated increasing the cache age may prevent those accessing a cached version of the pages from seeing an up to date version.
2) Override cache control headers
The caching app is set up to automatically respect any caching rules set up for your site when you integrate. However, sometimes the cache control headers set up at your server end can prevent our cache from hitting. These can include cache-control headers, vary headers and expires headers.
You are able to override these headers by navigating to the caching app and selecting 'Update Cache Setting Values'. From there, you can edit the 'Override cache control headers' from 'false' to 'true' and select 'Update Domain Setting Values' when this is complete.
*Please note that if you have a Vary by Cookie set, this may be important to the functionality of your site. Therefore, if we override this rule, our caching will ignore any cookies that are set for the use of changing your site content. If the functionality of your site is negatively affected, you can switch this setting back to 'false'.
3) Remove any incompatible caching plugins
If you are integrated using the Wordpress plugin method, are seeing a high cache miss rate, it may be worth checking that you don't have any incompatible caching plugins enabled for your site that cache in front of Ezoic. Examples of typically incompatible caching plugins include:
- Swift Performance Cache
- LiteSpeed Caching
- WP Fastest Cache
- AutoOptimise/AutOptimise cache
- SG Optimizer
More information on technology that is incompatible with our speed tools can be found here: https://www.ezoic.com/compatibility/
4) Check your Cloudflare caching settings
You can use both Cloudflare caching and the Ezoic Caching app at the same time, as this will just give your site two layers of caching. If you are using your own Cloudflare account through Cloudflare integration, you will just need to make sure your Cloudflare cache settings are set to "standard" or "aggressive" so that they are compatible with Ezoic's caching app. If the cache hit rate is significantly lower than expected, it is always worth checking that your settings in Cloudflare are set to 'standard'.
Is there anything else I should be aware of?
More information on Ezoic's CDN and caching app can be found here.