What is Cache – differences between server, browser and more explained
Most internet users have come across the term cache before. Nevertheless, many people ask “What is cache” and do not know what cache is used for. Let’s first translate cache: German uses the English term as a loan word. Translated, it means nothing more than a hiding place and is used in information technology for a (hidden) buffer memory.
See the next section for a detailed explanation of the concept of cache . In this blog post, we also clarify which specific use cases there are for the buffer memory on the web: we present server cache, browser cache and specific use cases using WordPress as an example.
What is cache? The concept briefly explained
In computer science, a fast buffer memory is called a cache. The aim is to reduce repetitive requests in order to get the desired result faster – for example loading a website. Because many elements of a website are the same: the logo, the header area, the main menu, the footer area and so on – many elements can be delivered much faster with a server cache or displayed faster with a browser cache.
In the real world, the cache concept can best be compared to a water tank on your coffee machine: the coffee machine has a water tank so that you don’t have to run to the tap for every cup. This serves as a buffer storage for water and allows you to (quickly) prepare several cups in a row.
Clear browser cache: What your browser caches and how to clear the cache
It doesn’t matter whether you use Google Chrome, Mozilla Firefox, Microsoft Edge, Apple Safari or another browser: they all use a cache. It stores various elements of every webpage you’ve recently visited.
The reason for this is simply that the loading processes should be accelerated when a website is called up again. Because many elements rarely change or not at all – usually only new ones are added. For example, think of a blog like this one: new articles are published all the time, old articles are pushed to the bottom. However, images and other content of previously published articles usually remain identical.
If the browser has stored such data, it does not have to download it from the Internet every time. This allows you to see the websites you visit regularly more quickly.
If necessary, each browser will let you clear the cache . On the one hand, you can free up storage space on your computer and, on the other hand, you can fix errors on websites. Because sometimes there are outdated files in the browser cache and display errors occur. In such a case, you can clear the cache so that all items are reloaded from the server.
Server cache: what forms there are
Various caching mechanisms can be used on the web server side. On the one hand techniques used at the level of a web server (like Nginx) and on the other hand at the application level (e.g. a CMS like WordPress). The latter is also referred to as site cache or page cache, since the actual website controls the caching here.
server cache
A server cache for a web server typically includes methods for accelerating the execution of the software running on it. This can be PHP applications such as WordPress, for example, which run faster thanks to caching. In such an application, PHP functions are executed, which are cached in the so-called OPCache . In addition, most applications also use a database. There is an object cache for frequently executed database queries in order to reduce access times here as well.
Server cache what forms there are
The cache lifetime of the browser cache can also be set on the server side . To do this, the server tells the browser how long certain files on a website should be saved (e.g. each image should be saved for 30 days).
Page Cache / Site Cache
This type of cache runs at the application level and ensures that web pages are delivered to the browser faster. To do this, a page cache is created, i.e. a buffer memory for each page that is part of a website. Web pages stored there are static HTML pages, so they can become outdated if changes are made. Depending on the frequency of changes to a website, it is therefore advisable not to set the cache lifetime too long.
In the next section, we use WordPress Cache as an example to explain how page caching works in practice.
WordPress cache: Useful extensions for more WordPress performance
The basic function of a content management system (CMS) is to generate all pages dynamically and deliver them directly after a request. A caching solution initially seems contradictory if it caches complete subpages, since it undermines the principle of dynamically generated pages. Instead, such content is stored and delivered as static HTML files.
Anyone who deals with the topic of optimizing WordPress and values good loading times will quickly notice that you can hardly avoid a WordPress cache . You continue to enjoy all the benefits of a CMS, i.e. easy management and delivery of your content. Frequently viewed subpages or posts that rarely change lend themselves best to caching. This is especially true if they do not contain any dynamic elements such as widgets or comment functions.
If you search for cache in the WordPress plugin directory , you will find hundreds of hits. From the large number of WordPress cache plugins, some are recommended and already tried and tested:
- W3 total cache
- WP Super Cache
- WP Rocket (paid)
Once set up, you can start caching your website right away. Our recommendation is WP Rocket as it packs many features like cache warming, lazy loading, and minification under a catchy interface.
One last tip: After a major change to your website, you should clear the WordPress cache . This will prevent your users from being misrepresented. If your selected plugin supports this, then let the cache be automatically filled again (cache warming).
In our article, we have shown various methods of optimizing website performance using cache. PHP applications such as WordPress in particular benefit enormously from the correct cache configuration, both at the page cache and at the server cache level. And the browser cache should not be forgotten either, because the fewer requests (recurring) users have to make to a server, the more the server is relieved.
Have you exhausted all caching options on your website? We would be happy to help you optimize WordPress or other web applications.