
Every speed optimization guide says, “Install a caching plugin,” but which one, and what does it actually do? WordPress has four caching layers: browser caching, page caching, object caching for database queries, and server caching, such as LiteSpeed. Page caching delivers the biggest performance gains, while object caching is particularly useful for online stores and logged-in users. Below, you’ll learn which layers you need and how to set up caching without breaking your online store. Caching is one of the steps in How to Speed Up WordPress: The Complete Guide.
What is caching?
Caching is the process of storing a pre-generated result so that it doesn't have to be recalculated every time a visitor accesses the page. Without caching, WordPress builds each page from scratch for every visitor. The server runs the PHP code, retrieves the content from the MySQL database, assembles everything, and only then sends back the HTML. With caching, that work is done only once, and subsequent visitors receive a cached HTML copy. This reduces the computational load, so the server can handle higher traffic for longer, and the TTFB—the time to the first server response—is reduced.
I always explain it using the example of a baker. He prepares his best-selling loaves first thing in the morning, instead of baking each loaf only when a customer walks in. He does, however, bake a custom-ordered cake fresh, and in WordPress, those are the shopping cart and the checkout. I’ll come back to that later. The downside of pre-baked bread is that it doesn’t refresh automatically. If you make a change and still see the old version, you’ll need to clear the cache. You can read about how that works at Clearing the Cache in WordPress.
The Four Caching Layers at a Glance
Each of the four layers stores something different in a different location, and they complement each other rather than replace one another.
| Low | What Is Stored | Where | Who sets it up? |
|---|---|---|---|
| Browser Caching | Images, CSS, JavaScript | Visitor's browser | Caching plugin or server |
| Page Caching | Complete HTML pages | Server | Caching Plugin |
| Object caching | Results of database queries | Working Memory (Redis, Memcached) | Hosting Plus Plugin |
| Server Caching | Pages, even before WordPress starts | Web Server (LiteSpeed) | Hosting |
Browser caching stores static files in your visitor's browser, with an expiration time. The server specifies this in headers such as Cache-Control with max-age, Expires, and ETag. If a visitor returns and a file hasn’t changed, the server responds with a 304 status code instead of resending everything. You’ll notice this especially with returning visitors.
Page caching stores entire HTML pages so the server doesn’t have to rebuild them for every visitor. This provides the greatest benefit for visitors who aren’t logged in—which, on most sites, is virtually everyone. My advice, therefore, is to start here. In addition, there’s OPcache, which caches compiled PHP code, and CDN caching on servers located around the world. Your hosting provider handles the former; at Surver, OPcache is enabled by default.
Object caching and server caching: When do you need them?
Object caching stores the results of database queries in memory—usually via Redis or Memcached—and helps precisely where page caching falls short. A WooCommerce store, a membership site, or your own dashboard is difficult to cache as an HTML copy because the content varies by visitor. In such cases, it makes a big difference if the database doesn’t have to answer the same query over and over again. In Site Diagnosis, WordPress sometimes recommends a persistent object cache. This requires Redis or Memcached on the server, and with Surver, Redis is only available on Surver Cloud. On shared hosting, you can safely leave that message as is as long as your page caching is set up correctly. You can find more information in Object Caching and Redis Explained.
Server caching is caching performed by the web server itself, such as LiteSpeed or Varnish. This is faster than caching via a PHP plugin, because WordPress doesn't even have to start up. However, it does require that your hosting provider runs the right web server. On a LiteSpeed server, the plugin works LiteSpeed Cache directly in conjunction with the server cache, which you don't get with other plugins. More on that in What Makes Up Fast WordPress Hosting.
So what do you need? For a business website or blog, page caching and browser caching are enough, along with server caching if your host offers it. A high-traffic content site with a lot of international traffic would also benefit from a CDN for WordPress. Object caching only becomes useful for an online store or membership site with a large number of logged-in users.
Setting Up and Checking Caching
You set up caching using a single caching plugin that's compatible with your web server, and then you check to see if it actually works. That's how I do it myself.
- Check which web server your hosting provider uses.
- Choose the plugin that's right for you. On a LiteSpeed server, that's LiteSpeed Cache; elsewhere, it could be WP Super Cache, W3 Total Cache, or WP Rocket.
- Use only one caching plugin, and don't use a plugin alongside your host's cache if it performs the same function.
- Enable page caching and browser caching.
- Set an expiration time and have the cache preload (in LiteSpeed Cache, this is called the crawler), so that the first visitor doesn't have to wait for an empty cache.
- Check the default exclusions and test while logged out in a private window.
That third step is more important than it seems. Two caches handling the same layer won’t make your site faster—they’ll make it unpredictable, resulting in outdated pages and broken layouts. You can check if it’s working in your browser’s developer tools. Open the Network tab, reload the page twice while logged out, and check the response headers. On a LiteSpeed server, the second request will show x-litespeed-cache: hit, other plugins send a similar header. If you don't want to set up and maintain caching yourself, then it's part of WordPress Management.
Pages You Should Never Cache
Pages with personal or constantly changing content should never be included in the page cache, because otherwise one visitor might see the data intended for another. Here they are.
- The shopping cart, checkout, and My Account.
- Pages for logged-in users. WordPress identifies them using a cookie, so the caching plugin excludes them from the page cache.
- Pages with forms or content that varies by visitor.
If this goes wrong, a customer might suddenly see someone else’s shopping cart, or your contact form might stop working. Most caching plugins automatically exclude WooCommerce’s core pages, but I always double-check just to be sure. An online store works best on hosting that’s designed for that purpose, such as Managed WooCommerce Hosting. If your store is still slow, read Slow WooCommerce online store.
What we handle as standard at Surver saves you a significant amount of this work. All of our shared hosting plans Managed WordPress Hosting run on LiteSpeed servers with NVMe storage, and LiteSpeed Cache is the right plugin for that. When setting up a new package, we install WordPress via Installatron with LiteSpeed Cache included. If you’re installing it yourself, you’ll need to add the plugin yourself. If caching is set up correctly and your site is still slow, then the cause lies elsewhere. Then follow the complete guide or let us take a look with WordPress Speed Optimization.
Frequently Asked Questions
Which is better, WP Rocket or LiteSpeed Cache?
That depends on your web server. On a LiteSpeed server, you should use LiteSpeed Cache, since it works in conjunction with the server cache. Otherwise, WP Rocket (paid) is a great choice, as is the free WP Super Cache.
Can caching break my site?
While not a permanent issue, improperly configured caching can display outdated pages, break the layout, or cause the shopping cart to malfunction. A broken layout is often caused by minification or lazy loading, features that caching plugins often include. First, clear the cache, and then revert the settings one by one.
Does Surver have built-in caching?
Yes. All of Surver's shared hosting plans run on LiteSpeed servers with LiteSpeed Cache, and OPcache is enabled by default. Surver offers object caching with Redis on Surver Cloud.