Book a call Free rebuild

Caching

June 15, 2022 Updated November 16, 2026 2 min read

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

LayerWhat it storesWhere it lives
Browser cacheImages, CSS, JavaScript, and fonts already downloadedThe visitor's device, controlled by Cache-Control headers
CDN or edge cacheStatic files, and sometimes whole pagesServers near the visitor
Page cacheFinished HTML pagesThe web server, through a plugin or the host (often nginx or Varnish)
Object cacheResults of database queries and other computationsMemory, through Redis or Memcached
Opcode cacheCompiled PHP codeServer 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

  1. 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.
  2. If there is no server cache, use one well-maintained caching plugin, not several.
  3. Add a persistent object cache if the host supports Redis or Memcached.
  4. Put a CDN in front for static files, and for full pages if it supports WordPress-aware HTML caching.
  5. 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.

WP Services

WordPress services at revolutionary pricing.

Productized WordPress services, from builds to care, delivered by Seahawk and tracked in one app. For the WordPress lovers.