WordPress  Cache 101. How a cache makes your WordPress  projects faster

Indispensable: Without WordPress cache, you can forget about the loading time of your WP projects.

Without a proper cache WordPress sites is agonizingly slow. For this reason, we will explain in this article what types of caching there are, how they work and how you can use caching on your WordPress sites .

As a shop owner or blogger you know the problem that your users and readers are not the most patient: If a site takes too long to load, they quickly bounce back. 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 the loading time. Because caching ensures that WordPress does not have to rebuild every site in the browser, but can fall back on an already built version.

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.

So today I'm going to explain to you:

How caching works with WordPress

In principle, the more dynamic elements your WordPress site contains, the longer the loading time. Dynamic elements are, for example, shopping carts, interactive calendars or maps. In short: all elements and functions that need to be updated frequently or loaded individually. Static elements, on the other hand, are elements that remain the same for all users or specific user groups. These parts of your site can simply be cached.

And that's exactly what a cache always does: It transfers the mixture of stylesheets, JavaScript, images, etc. into a static HTML document, stores it temporarily and delivers it on page load. So every visitor of your site gets one and the same template delivered. This way, you don't have to recalculate each element on every page load. Therefore, a cache is much faster than the standard page load.

In the case of an uncached page request, to put it simply, the web server and databasemust be addressed. Computing processes take place on both. A cache bypasses these calculations and thus saves a lot of time.

A WordPress cache not only shortens the distance a request has to travel, but also provides a faster-to-load variant of the site output.
A cache "shortens the path" that the site has to travel to the user. With the page cache, a version of the site is stored on the server. Even faster is the browser cache, where the site is stored directly in the visitor's browser.

The caching system is doubly important at WordPress . Because WordPress is based on PHP. Without caching WordPress sites will only run fast without caching if you have powerful and expensive hardware. Caching is therefore elementary for your WordPress projects.

The caches themselves are stored either on the hard disk or in the main memory. Some plugins offer the possibility to switch between both. A cache that is stored in the working memory is delivered particularly quickly. However, this also reduces the computing power that is available to you from site now on. Therefore RAM-based caches are more common for sites extremely high traffic. Because there is enough hardware power available anyway.

If the cache is on the hard disk, it is delivered much slower. This is especially true if your web server uses an HDD hard disk. SSD hard disks are therefore also a sensible investment with regard to the WordPress cache, as they are many times faster than their HDD predecessors. A cache on the hard disk of your web server does not burden its processing power.

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

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

Selection of cache types for WordPress
Selection of the types of caches for WordPress

Both ways have at their heart the creation of a so-called page cache. This means that a site is completely loaded at fixed intervals and stored as a static HTML version in the cache. If a visitor now calls up this site , he receives the prefabricated "page" in a fraction of a second.

Another way is to use the browser cache. Here the data is not cached on your server, but on the end device of your visitors. Their web browser saves the site data - and then has it at hand faster for repeated page views. You can activate the browser cache via plugins caching in WordPress, as well as through settings in the .htaccess file. If your hoster does the caching for you, it should configure the browser cache accordingly. Important for the browser cache is the update interval. A common value is for example one month, so 30 days.

Implementation: Per Plugin or host

There are some very popular cachingPlugins. For example W3 Total Cache, WP Super Cache or Cachify. They range from extremely complex to extremely simple and include both free and paid offerings.

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

Caching with costs plugins can sometimes do much more than just caching: they compress code, optimize it, cache the databasesite , define the browser cache for visitors and much more. This in turn leads to powerful caching plugins may require a lot of configuration work until they really run optimally.

Dynamic elements can also be partially cached

Even if the page cache is the most important tool in WordPress caching and usually offers the highest savings potential in terms of loading time, you do not have to limit yourself to it. Because parts of the site that are not covered by a page cache can also be cached. For example, there is the database: A database c ache temporarily stores frequently requested database content and thus accelerates non-cacheable page calls.

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

A WordPress cache also has disadvantages

Noticeably reducing the loading time of your WordPress site is the most important goal of caching. But the caches also bring 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, for example, to subsequently edited blog entries, but also to product descriptions. For example, if you insert a new photo instead of an existing image, users may still see the old image from the cache for days.

You should be aware of this problem, but it is not serious. Because many caching tools allow you to set the "expiration 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 empty your cache after important changes, you can do little wrong here.

Also, you should always keep in mind that there are certain dynamic elements that simply cannot be cached. This applies, for example, to shopping carts or personalized content or product suggestions. A cache would also make no sense here, because it would undermine the individualization and personalization of these elements. The same applies to surveys or individualized calendars, for example. This is also the reason why WordPress sites with such elements need more computing power.

Conclusion: Setting the WordPress cache correctly can quickly become very complex.

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

Even the large and powerful caching plugins is not easily and quickly configurable in such cases. However, they offer a lot of adjustment screws for optimizing the loading time. 

Server-side caching, i.e. via the web hoster, is certainly the simplest solution. Because here, one click is usually enough to equip the site with the appropriate caches. However, the range of functions of these caches can vary from provider to provider and is also partly not configurable in detail by the site operator.

You have already gained experience with various caching plugins or even input for our server-side WordPress cache? Then we are looking forward to your feedback!

Did you like the article?

Your rating helps us improve our future content.

Post a comment

Your email address will not be published.