Cardboard Box with Fragile Label
Picture of Nick Green

Nick Green

The Benefit of Caching Web Pages

Why should I bother with caching on my website and actually what is it anyway?

To cache something means to u201cstore away in hiding or for future useu201d on a computer or web server it just means store for future use; because with websites we are dealing with two different caches of data the visitors device they are browsing with and the web server that send the data.

Let us think of your website as a number of books that you want to display for people to look at. If you have a website built using HTML (HyperText Markup Language) itu2019s like displaying your books on a store bought bookcase they are there and available from the get go. If, however, you use something like WordPress the bookcase you use is more like an Ikea flat pack you have to build the bookcase before you can put the books on it. WordPress sites are created using a language call PHP and only when all the information is assembled is it converted into HTML to send to the visitor.

A WordPress site, therefore, always has the potential to be slower that an HTML site because of the delay in u201ccompilingu201d the page; this is further compounded if the hosting service is slow like many of the cheap shared platform suppliers are. If we implement a caching plugin on a WordPress site then the first time a page is compiled and delivered the caching plugin will keep a copy of the page (now in HTML) u201cfor future useu201d. The visitor that requests the page will be provided with the cached copy with no delay in compiling the data. If the first person to visit the page is you (when you are testing the final version) then the only person to experience the delay will be you.

On an HTML site this type of caching is not required but there needs to be information supplied to the visitoru2019s browser about the information on the site and whether any of it (usually images u2013 the things that take the most time to collect) can be cached by the browser. Think of it as borrowing some of the books off the bookshelf and like all lending libraries there is a time limit on how long the data can be cached for before the browser has to ask for a fresh copy. This is done in a special file the u2018dotu2019htaccess (.htaccess) and fortunately the WordPress plugins automatically create one of these for you as well.

If you are using a good quality hosting service implementing a caching plugin will just add some extra speed to your site if you hosting service is less than optimal then a caching plugin can be the difference between a usable and unusable site. There are numbers of caching plugins but W3 Total Cache and my preference Wordfence with Falcon both seem to u201cplay nicely with othersu201d.

Post – Post note. WordFence have discontinued Falcon.

Share this post