WordPress caching

Indispensable: You can't do without WordPress caching

It's not just good WordPress hosting that improves the loading time of your website - without proper caching, WordPress websites are agonizingly slow. That's why in this article, we'll explain what types of WordPress caching there are, how they work and how you can use caching on your WordPress websites.

You are no doubt familiar with the problem that people are not the most patient people on the Internet these days: If a website takes too long to load, they quickly bounce. It's a matter of fractions of a second - and this is where caching comes into play. It is by far the most important tool for optimizing loading times. This is because caching ensures that WordPress does not have to rebuild every website in the browser, but can fall back on a version that has already been built.

And because WordPress is based on PHP, which makes the CMS relatively slow, this caching is the most important factor for your page load time.

How WordPress caching works

In principle, the more dynamic elements your WordPress website contains, the longer it takes to load. Dynamic elements include shopping baskets, interactive calendars and maps. In short: all elements and functions that require frequent updates or need to be loaded individually. Static elements, on the other hand, are elements that always - or at least for certain user groups - remain the same. These parts of your site can simply be cached.

And this is exactly what a cache basically always does: it transfers the mixture of stylesheets, JavaScript, images etc. into a static HTML document, stores it temporarily and delivers it when the website is called up. The same template is therefore delivered each time the website is called up. This means that each element does not have to be recalculated each time the website is called up. This is why the call with caching is much faster than without.

In simple terms, the web server and database must be addressed when the website is called up uncached. Computing processes take place on both. A cache bypasses these computing processes and therefore saves a lot of time.

WordPress Caching Page Cache
A cache "shortens the distance" that the page has to travel to the end device. With a page cache, a version of the page is stored on the server. The browser cache, where the page is saved directly in the browser, is even faster.

The caching system is doubly important for WordPress, because WordPress is based on PHP. Without caching, WordPress websites only run really fast with correspondingly powerful and therefore expensive hardware. Caching is therefore essential for your WordPress websites.

The caches themselves are stored either on the hard disk or in RAM. Some plugins make it possible to switch between the two variants. A cache that is stored in RAM is delivered particularly quickly. However, this also reduces the computing power available to your website. For this reason, RAM-based caches are more common for websites with extremely high traffic, as there is sufficient performance available here anyway.

If the cache is on the hard disk, it will be delivered much more slowly. This is especially true if your web server uses an HDD hard disk. SSD hard disks are therefore also a sensible investment in terms of WordPress caching, as they are many times faster than their HDD predecessors. Caching on the hard disk of your web server also does not burden its computing power.

WordPress caching is possible in the browser and on the web server

Basically, you have two options to quickly benefit from good WordPress caching. Either you use a caching plugin, or your web host has already set up a cache on the server side.

WordPress Cache Types
Selection of types of caches for WordPress

At the heart of both methods is the creation of a so-called page cache. This means that a website is completely loaded at fixed intervals and saved as a static HTML version in the cache. When this website is called up, the prefabricated website is now delivered in fractions of a second.

Another way is to use the browser cache. The data is not cached on your web server, but on the end device. Their web browser saves the page - and then has it available more quickly for repeated visits. You can activate the browser cache via WordPress caching plugins as well as through settings in the .htaccess file. If your web host handles the caching for you, it should configure the browser cache accordingly. The update interval is particularly important for the browser cache. A common value is one month, i.e. 30 days.

WordPress caching plugin - or server-side from the web host

There are some very popular WordPress caching plugins. For example, W3 Total Cache, WP Super Cache or WP Rocket. They range from extremely complex to extremely simple and include both free and paid options.

Handling and support also differ: paid plugins often offer more setting options and personal support, while free plugins usually "only" rely on a support forum.

Some paid WordPress caching plugins can do much more than just caching: they compress code, optimize it, cache the database, the page, define the browser cache and much more. This in turn means that powerful WordPress caching plugins may require a lot of configuration work before they really run optimally.

Caching of dynamic elements

Even if the page cache is the most important tool for WordPress caching and generally offers the greatest potential savings in terms of loading time, you don't have to limit yourself to it. Parts of the page that are not covered by a page cache can also be cached. Take the database, for example: a database cache temporarily stores frequently requested database content and therefore speeds up calls that cannot be cached.

There is also the so-called object cache. This works in a similar way to the database cache: it temporarily stores frequently accessed dynamic elements. Incidentally, the combination of database cache and object cache is not recommended.

"*" indicates required fields

I would like to subscribe to the newsletter to be informed about new blog articles, ebooks, features and news about WordPress. I can withdraw my consent at any time. Please note our Privacy Policy.
This field is used for validation and should not be changed.

WordPress caching also has disadvantages

Noticeably reducing the loading time of your WordPress website is the most important goal of caching. However, caching also has a disadvantage: If the WordPress cache is activated, information is no longer retrieved live. Depending on the cache setting, your page content may be out of date. This applies to subsequently edited blog entries, for example, but also product descriptions. For example, if you insert a new photo instead of an existing image, the old image from the cache may still be displayed on the end devices for days.

You should be aware of this problem, but it is not serious. This is because many caching tools allow you to set the "expiry date" of the cache individually and also delete caches manually. The same applies to a server-side WordPress cache. So if you take care to clear your cache after making important changes, you can do little wrong here.

You should also always bear in mind that there are certain dynamic elements that simply cannot be cached. This applies, for example, to shopping baskets or personalized content or product suggestions. A cache would not make sense here either, as it would undermine the individualization and personalization of these elements. The same applies to surveys or personalized calendars, for example. Incidentally, this is also the reason why WordPress websites with such elements require more computing power.

Conclusion: Setting up WordPress caching correctly can be complex

In theory, a cache is relatively simple: it saves the page and makes it accessible more quickly by switching off computing processes and database queries. In practice, however, this concept applies to dynamic and personalized page content. Activating and setting up a cache can therefore be very quick for some WordPress websites, but a lot of work for others.

Even the large and powerful WordPress caching plugins are not easily and quickly configurable in such cases. However, they do offer a lot of levers for optimizing the loading time. 

Server-side caching, i.e. via the web host, is certainly the simplest solution. This is because one click is usually enough to equip the page with the corresponding caches. However, the range of functions of these caches can vary between web hosts and in some cases cannot be configured in detail.

Do you already have experience with various WordPress caching plugins or even input for our server-side WordPress cache? Then we look forward to your feedback!

Did you like the article?

With your rating you help us to improve our content even further.

Write a comment

Your e-mail address will not be published. Required fields are marked with *