Performance glossaryCaching is storing a ready-made copy of a page or file so it can be served again without rebuilding it, which makes sites faster and lighter on the server.
Caching means keeping a copy of something that was expensive to produce so it can be reused. On a website, that might be a whole HTML page, the result of a database query, compiled PHP code, or an image. Serving the copy skips the work of building or fetching it again, which makes pages faster and lets the same server handle many more visitors.
WordPress shows why it matters. Without caching, every page view runs PHP, loads the theme and plugins, and queries the database before any HTML is sent. Most pages are identical for every logged-out visitor, so repeating that work on each request is wasted effort. A page cache does it once and reuses the result.
The main types of caching
| Layer | What it stores | Where it lives |
|---|---|---|
| Browser cache | Images, CSS, JavaScript, and fonts already downloaded | The visitor's device, controlled by Cache-Control headers |
| CDN or edge cache | Static files, and sometimes whole pages | Servers near the visitor |
| Page cache | Finished HTML pages | The web server, through a plugin or the host (often nginx or Varnish) |
| Object cache | Results of database queries and other computations | Memory, through Redis or Memcached |
| Opcode cache | Compiled PHP code | Server memory, through PHP's OPcache |
WordPress has an object cache built in, but by default it only lasts for a single request. A persistent object cache such as Redis keeps it between requests, which helps most on logged-in, WooCommerce, and membership sites, where full pages cannot be cached.
Why it matters
- Speed. A cached page can be sent almost immediately, which lowers Time to First Byte and, with it, Largest Contentful Paint.
- Capacity. Serving cached HTML takes a fraction of the CPU and database work, so traffic spikes are far less likely to take the site down.
- Cost. The same traffic needs fewer server resources.
Speed feeds into Google's page experience signals through Core Web Vitals, but it is a light ranking factor next to relevance and content quality. The clearer gains are for visitors.
Setting up caching in WordPress
- Check what the host already provides. Many managed WordPress hosts run server-level page caching and ask customers not to add a second caching plugin.
- If there is no server cache, use one well-maintained caching plugin, not several.
- Add a persistent object cache if the host supports Redis or Memcached.
- Put a CDN in front for static files, and for full pages if it supports WordPress-aware HTML caching.
- Give versioned static files long browser cache lifetimes.
What not to cache
Anything personal or specific to one visitor must bypass the page cache: logged-in sessions, the WooCommerce cart, checkout, and account pages, and pages with forms whose security tokens (nonces) expire before the cached copy does. Good caching plugins exclude the standard WooCommerce pages automatically, but custom membership areas and booking flows often need manual exclusions.
When changes do not show
Because visitors are served copies rather than the live page, an edit may not appear straight away. Clearing the cache is the usual first troubleshooting step, and several layers may each hold an old copy. See cache invalidation for how to clear them in the right order.