chevron_right
chevron_right
How to improve my cache hit rate?
How-To/Instructional

How to improve my cache hit rate?

Last Updated a month ago
Article Navigation
Introduction
Steps
Video
Additional Issues to Be Aware Of
FAQs
Need Further Assistance?

Introduction

Improving your cache hit rate is crucial for enhancing the speed and performance of your website. A high cache hit rate ensures that user requests are quickly fulfilled by the closest edge server, significantly reducing load times compared to requests served by the origin server. This article will guide you through understanding what a cache hit rate is, why it is important, and how you can monitor and improve your cache hit rate using Ezoic's tools. By following the steps outlined, you can optimize your site’s speed and user experience effectively.

Steps

1. View URLs that are not getting cached using BDA:

  • Navigate to Ezoic's Analytics.
  • Scroll to Site Speed > Caching > Ezoic Caching.
  • Click on 'Cache Miss' to load a report of all the pages not being cached and reasons for not caching.

  • Alternatively, go to Leap > Caching > and scroll down to the Debug Cache tool to check any URL from your site. The Debugger will identify why the URL isn’t cached or confirm if the page is being cached. It will also show a list of the top URLs on your site that have been cache misses.

2. Increase the cache age:

  • Ezoic's caching respects the 'maximum cache age' headers that are set on the origin server. If no maximum age is specified in the headers, Ezoic sets a 'Default Cache Age' of 30 days (2592000 seconds). This means that your pages will be stored in our CDN for 30 days before they are updated.
  • To increase the 'Default Cache Age', navigate to Leap > Caching > Advanced Settings and edit the number of seconds for 'Default Cache Age'. The minimum Default Cache Age is 1 hour (3600 seconds).

  • Note: If your site's content is regularly updated, increasing cache age may prevent users who are accessing a cached version of the pages from seeing the latest version. We recommend using Ezoic's WordPress plugin to automate clearing the Ezoic cache when changes are made.

3. Override cache control headers:

  • Ezoic's caching respects existing caching rules set at the origin. However, cache control headers, vary headers, and expires headers can sometimes prevent our cache from hitting.
  • To override these headers, navigate to Leap > Caching > Advanced Settings and then edit 'Override Cache Control Headers' from 'OFF' to 'ON'.

  • Note: If you have a Vary by cookie set that is important to the functionality of your site, turning on Override may affect site functionality. If the functionality of your site is negatively affected, you can switch this setting back to 'OFF'.

4. Remove any incompatible caching plugins:

  • Some caching plugins are incompatible with Ezoic because they cache in front of our system, preventing Ezoic's features from functioning on your site.
    • Incompatible plugins: Swift Performance Cache, LiteSpeed Caching, WP Fastest Cache, AutoOptimise/AutOptimise cache, WP-Optimize, SG Optimizer.

5. Check your Cloudflare caching settings:

  • Using Cloudflare caching and Ezoic Caching simultaneously provides two layers of caching.
  • If you don't have your own Cloudflare account, you can enable Cloudflare's CDN through Ezoic by going to Settings > Connection > Cloudflare > click the green button that says Activate Via Ezoic.
  • If you have your own Cloudflare acount and are Cloudflare integrated with Ezoic, ensure your Cloudflare cache settings are set to "standard" or "aggressive" to be compatible with Ezoic's caching. If the cache hit rate is lower than expected, verify that Cloudflare settings are set to "standard".

Video

 

Additional Issues to Be Aware Of

  • Some WordPress theme settings that minify, async, or defer scripts may prevent Ezoic from caching.
  • WordPress plugins that do image optimization often cache images on their own CDN may hinder Ezoic's caching and optimization capabilities. They may add significant time to loading speeds.
  • Speed and caching plugins that minify, cache, defer, or async code elements of the site could also result in Ezoic being unable to cache pages effectively.

FAQs

1. 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.

2. Why is this important?

Take a look at the image below. 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 affects 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.

3. What is 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, when Ezoic's CDN returns 95 cache hits and 5 cache misses, the cache hit rate would be 95%.

4. 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. You can also view the cache hit % on the home page of your Ezoic Dashboard.

Need Further Assistance?

For further assistance, you can reach out to Ezoic support at support.ezoic.com.

 

× Enlarged Image

Loading ...