Web Cache: How It Works and How to Configure It
What web cache is, the types (browser, server, database) and how to configure it in WordPress and other CMS to speed up your website.
In this article
Introduction
Cache is the most effective way to speed up a website. Properly configured, it can cut load time in half or more. But it’s one of those things many people don’t understand: what exactly is it? What’s it for? How is it configured?
In this article you’ll see what cache is, what types exist, and how to enable it on your website, especially if you use WordPress.
What cache is (in plain words)
Cache is like keeping a ready copy of something so you don’t have to prepare it again.
Imagine a restaurant. Every time a customer orders bread, the chef could make it from scratch (mix, knead, bake). It would be terribly slow. Instead, the chef has bread already made and ready to serve. That’s cache: serving something already prepared instead of preparing it each time.
The same happens on a website: every time a visitor enters, the server could build the page from scratch (query the database, execute PHP, generate HTML). It’s slow. With cache, the server has a ready copy and serves it directly.
[Imagen sugerida: diagram of how cache works on a website]
Without cache, WordPress can take 1-2 seconds to generate a page. With cache, it serves it in milliseconds.
Types of cache
There are several types of cache. The ideal is to combine them.
1. Browser cache
The visitor’s browser (Chrome, Firefox, Safari) saves copies of your website’s static files: images, CSS, JavaScript. This way, when they return, it doesn’t download them again.
It’s configured with HTTP headers that tell the browser how long it can keep each file.
2. Page cache (the most important)
The server keeps a copy of each page’s generated HTML. When another visitor enters, instead of generating the page again, it serves the copy.
It’s the type of cache with the most impact on speed.
3. Database cache
Saves the results of frequent database queries so they’re not repeated.
4. Object cache
Stores PHP objects (for example, WordPress results) in memory so they don’t recalculate. Usually uses Redis or Memcached.
5. Web server-level cache
Servers like LiteSpeed or Nginx have their own cache that’s even faster than PHP’s.
At miHosting we use LiteSpeed on many plans, which has web server-level cache. It’s one of the secrets of why websites hosted with us load so fast.
How to configure cache in WordPress
WordPress doesn’t include page cache by default (only partial object cache). You need a plugin.
Recommended plugins
| Plugin | Ideal for | Notes |
|---|---|---|
| LiteSpeed Cache | Hosts with LiteSpeed | The fastest if your host uses LiteSpeed |
| WP Rocket | Any WordPress | Paid, very complete and easy |
| W3 Total Cache | Any WordPress | Free, many options |
| WP Super Cache | Simple blogs | Free, simple |
| WooCommerce | Online stores | LiteSpeed Cache or WP Rocket (with WC support) |
If your host uses LiteSpeed (like miHosting plans), LiteSpeed Cache is the best option: free and the fastest.
Basic LiteSpeed Cache configuration
- Install the LiteSpeed Cache plugin from Plugins → Add New.
- Activate it.
- Go to LiteSpeed Cache → Cache.
- Enable Enable Cache.
- In the TTL tab, define how long cache is kept (3600 seconds = 1 hour is a good value).
[Imagen sugerida: screenshot of LiteSpeed Cache configuration in WordPress]
Basic WP Rocket configuration
- Install WP Rocket (paid).
- In the Cache tab, enable:
- Mobile device cache.
- User cache (optional).
- In File Optimization, enable CSS and JavaScript minification.
- In Preload, enable automatic cache generation.
Cache in PrestaShop and Magento
PrestaShop
PrestaShop includes its own cache system:
- Go to Advanced Parameters → Performance.
- Enable cache.
- Select the cache system (Smarty should be set to “Recompile only if template files are updated”).
- If you have Memcached or Redis available, enable it.
Magento
Magento 2 has integrated cache:
- Go to System → Cache Management.
- You’ll see several cache types. Make sure they’re enabled.
- For large stores, configure Redis for session and page cache.
How to clear the cache
Sometimes you need to clear the cache so changes show up:
- WordPress + LiteSpeed Cache: LiteSpeed Cache → Toolbox → Purge All.
- WordPress + WP Rocket: Top bar → Clear cache.
- PrestaShop: Advanced Parameters → Performance → Clear cache.
- Magento: System → Cache Management → Flush Magento Cache.
If you make a change to your website and don’t see it, it’s almost always cache’s fault. Clear it and try again.
Cache and dynamic content
Cache serves static pages. But there are parts of your website that should not be cached:
- The shopping cart in an online store.
- The logged-in user panel.
- Forms.
Good cache plugins detect this and don’t cache those pages. But if you notice a customer seeing another’s cart, disable cache for checkout pages.
In WooCommerce, use a cache plugin with specific online store support, like LiteSpeed Cache or WP Rocket. They automatically configure what to cache and what not.
Useful tips
- Start with page cache. It has the most impact.
- Enable browser cache. It’s free and reduces repeated loads.
- Don’t accumulate cache plugins. One well-configured plugin is better than three that clash.
- If your host uses LiteSpeed, use LiteSpeed Cache. There’s nothing faster.
- Clear the cache after major changes. It’s the number one reason “my change isn’t visible”.
Common problems
I made a change and can’t see it
Clear the cache. If you use a WordPress optimization plugin, clear its cache too. And if you have Cloudflare, purge Cloudflare’s cache too.
The store cart doesn’t work
It’s a cache problem caching pages it shouldn’t. Configure the cache plugin to not cache the cart, checkout and user account.
The website is slower after enabling cache
The cache plugin may be misconfigured, or you may have two cache plugins at once. Use only one.
The visitor counter drops after enabling cache
It’s normal. Cache serves static pages, and analytics scripts may not run the same way. Configure the plugin to exclude important pages or use a compatible analytics method.
I don’t know if my host has LiteSpeed
Ask us. At miHosting, most professional plans use LiteSpeed. If you have it, LiteSpeed Cache is the best option for your WordPress.
Frequently asked questions
Can cache break my website?
If misconfigured, it can show old content or disable dynamic parts. But clearing the cache always solves it.
Do I need a cache plugin in WordPress?
Yes, highly recommended. Without page cache, WordPress generates each visit from scratch and is slow.
What happens if I don’t enable cache?
Your website will keep working, but will be slower. Google will penalize your SEO and users will leave.
Can I use LiteSpeed Cache without LiteSpeed on the server?
Not fully. LiteSpeed Cache is designed for LiteSpeed servers. If your host doesn’t use LiteSpeed, use another plugin (WP Rocket, W3 Total Cache, WP Super Cache).
Are cache and CDN the same?
No. Cache keeps copies on the origin server; a CDN keeps them on servers distributed around the world. They’re complementary.
Enable cache and notice the difference
Cache is the optimization measure with the most impact on a website’s speed. Enabling it is simple and the result is immediate: pages load much faster.
If your website is slow and you don’t have cache, that’s the first step. If you have a host with LiteSpeed and NVMe like miHosting’s, the result multiplies: LiteSpeed Cache turns your WordPress into an almost instantaneous website. Open a ticket from your client panel and we’ll help you configure cache correctly.