Back

From the support desk – when not to use WordPress caching

14 February 2020

Stuart

One of the major advantages of our WordPress Hosting is the built-in server-level caching. This not only negates the need for a plugin or CDN (Content Delivery Network, like CloudFlare) to do this, it’s also the fastest level of caching available. 

What is caching?

When the same content is being called again and again with no changes in subsequent requests (such as text and static images on your home page) there can be a delay whilst that content is pulled from storage, loaded into memory, compiled and displayed in a format your browser understands. Putting this page full of data together takes a moment and can result in a small delay for the person browsing your site. Caching gets rid of this by holding static elements pre-compiled and ready to display.

When shouldn’t you use caching?

In order to decide this, we need to look a little more closely at how pages get created in the cache in the first place. The first time that you or a site visitor visit a page is when the cached result gets put together. This means that the very first visit to a new page will result in fractionally slower load speeds.

If the page in question is something like a checkout page, this is bad news. The resulting cached page can contain a site visitor’s address details which are then served to the next person to get to the checkout stage. This would not be good. So let’s look at how you can prevent specific pages from being cached, or even turn caching off completely.

The above scenario is referred to as page caching. You can clear page caching from within WordPress itself – click on the hosting tools drop-down menu at the top of the screen and choose settings. You can clear the page cache and whitelist specific pages and/or folders from here (there’s also an option to clear all caches, see below).

The object cache is something slightly different and is used more with dynamic data. Let’s say that a link on your site leads to a product you are selling. When you click on the link, this generates a database query that spits back specific information about that product (what the product is, its colour, price, associated image, description etc.). Later on the process, (let’s say adding to basket) this same information request is re-generated. Rather than creating a new database query, WordPress object caching holds this information in memory for near-instant retrieval. 

You can use the “clear all caches” option described above if you suspect an issue with object caching. You can turn this off entirely as described at https://www.34sp.com/kb/120/controlling-caches-within-wordpress-hosting but this should only really be used for debugging as it gives a significant speed penalty.

In summary, caching is good. It speeds your site up and helps page ranking by being enabled. There are certain situations, though, where it should not be used and hopefully this post will help you identify where that might be.

Stuart

Stuart

Hi! I am the the co-founder of 34SP.com and Business Development Director; I've been at this hosting lark for more than twenty two years, ulp.. I oversee multiple areas of our business to ensure 34SP.com products and services are meeting our customer's needs. You can get in touch over on LinkedIn or replying to any of most posts. In my spare time I am exceptionally interested in food and drink, I run several food website and am a multi-award winning, food and drink writer.