Speed
Setting up WordPress caching: the ultimate guide
26 March 2025 · 4 min read
Caching is the secret weapon behind every fast WordPress website. By temporarily storing pages and files, the server does not have to regenerate everything every time. The result: loading times that are up to 80% shorter.
At WP Maintainer we install and optimise caching as a standard part of all our maintenance plans. In this ultimate guide we share all our knowledge about WordPress caching.
How does caching work?
When a visitor requests your website, WordPress dynamically generates the page. This costs server resources and time. Caching stores the generated page, so the next visitor gets the stored version — much faster. There are two main types: **Server-side caching:** The server stores generated pages (page caching, object caching, opcode caching) **Browser caching:** The visitor's browser stores static files (images, CSS, JavaScript)
Type 1: Page caching
Page caching stores the complete HTML page. This is the most impactful form of caching. Popular solutions: - **LiteSpeed Cache** — integrated with LiteSpeed servers, very fast - **WP Rocket** — premium plugin with excellent results - **W3 Total Cache** — free, many configuration options - **WP Super Cache** — simple and reliable from Automattic
Type 2: Object caching
Object caching stores database queries. WordPress executes dozens of database queries per page. Object caching — for example with Redis or Memcached — stores these results in memory. For websites with a lot of traffic or complex queries (such as WooCommerce), object caching is essential.
Type 3: Opcode caching
PHP is a scripting language that must be interpreted with every request. Opcode caching — enabled by default since PHP 5.5 — stores the compiled PHP code. This speeds up execution considerably. Make sure you use a recent PHP version (8.2+) for optimal opcode caching.
Type 4: Browser caching
Browser caching instructs the browser to store static files locally. On a subsequent visit these do not need to be downloaded again. Configure this via .htaccess or your caching plugin with expiry dates: - Images: 1 year - CSS/JS: 1 month (or use version numbering) - Fonts: 1 year - Documents: 1 week
CDN caching
A Content Delivery Network (CDN) stores copies of your website on servers worldwide. Visitors load your website from the nearest location. This reduces: - Latency (time to first byte) - Server load - Bandwidth costs
Common caching mistakes
**1. Caching dynamic pages** Shopping carts, checkout pages and user profiles must not be cached. Configure exclusions.
**2. No cache clearing** After a change the cache must be emptied. Automatic cache purging is essential.
**3. Cache times too long** Short cache times (1-6 hours) are better for dynamic sites. Static content can be cached longer.
**4. No test after configuration** Always test whether everything works after changing caching settings. Check forms, shopping carts and logged-in functionalities.
WP Maintainer caching optimisation
At WP Maintainer we install professional caching with LiteSpeed Cache on our optimised servers. We configure multiple caching layers, test thoroughly and monitor performance continuously. The result: loading times that often come in under 1 second.