WordPress Security and Performance

WordPress Caching Explained: Page, Object, Browser and CDN

The four layers of WordPress caching, what each one speeds up, how they work together, which pages must never be cached, and how to clear and test caches correctly.

Layered diagram of browser cache, CDN, page cache, object cache and database for a WordPress request

WordPress caching stores the results of expensive work so it does not have to be repeated on every request. There are four main layers: a page cache stores full HTML pages, an object cache stores database query results in memory, the browser cache keeps static files on the visitor's device, and a CDN serves cached files from servers near the visitor. PHP's opcode cache also stores compiled code. Each layer solves a different bottleneck, and most fast sites use all of them.

The caching layers

LayerWhat it storesSpeeds upTypical tools
Browser cacheCSS, JS, images, fontsRepeat visitsCache-Control headers
CDNStatic files, sometimes HTMLDistance and server loadCloudflare, Bunny, Fastly
Page cacheRendered HTMLServer response time (TTFB)Host cache, LiteSpeed Cache, WP Rocket, Nginx FastCGI
Object cacheQuery and computed resultsDynamic pages, admin, logged-in usersRedis, Memcached
Opcode cacheCompiled PHPAll PHP executionOPcache

Page cache

Without a page cache, every visit runs PHP and dozens of queries to build the same HTML. With one, the first visit builds the page and later visitors get the stored copy, often in milliseconds. It is the biggest single improvement for most content sites and directly improves time to first byte (reduce TTFB).

Never cache pages that differ per user: cart, checkout, my account, logged-in dashboards, course progress pages and anything showing a nonce. Good caching plugins and hosts exclude logged-in users and common e-commerce pages automatically, but check custom pages.

Object cache

WordPress has a built-in object cache that lasts only for one request. A persistent object cache such as Redis keeps those results between requests, so repeated queries for options, menus and post data come from memory. It helps most where a page cache cannot: logged-in users, WooCommerce, LMS dashboards and the admin. Setup is covered in Redis object cache for WordPress.

Browser cache and CDN

Set long cache lifetimes for versioned static files (a year is common), and short or no caching for HTML. WordPress adds ?ver= to enqueued files, so updates still reach visitors. A CDN copies those files to edge locations worldwide; some CDNs can cache HTML too, with rules to bypass logged-in sessions (CDN setup).

Clearing caches correctly

  1. Clear from the inside out: object cache (if data changed), page cache, then CDN.
  2. Most caching plugins purge affected pages automatically when you publish or update.
  3. After a theme or plugin update, purge everything once.
  4. Browser caches cannot be purged remotely, which is why versioned file names matter.

How to test caching

  • Check response headers in browser developer tools for cache status (for example x-cache: HIT or cf-cache-status: HIT).
  • Compare TTFB on the first and second load in a private window.
  • Use Query Monitor to see object cache hit rates when logged in.

Common mistakes

  • Running two page caching plugins at once.
  • Caching cart, checkout or account pages, so users see others' data.
  • Stacking a plugin cache on top of a host's server cache without coordination.
  • Expecting caching to fix a slow, uncached admin or heavy queries; those need code and database fixes.
  • Forgetting to purge the CDN after changes.

Frequently asked questions

Which cache matters most?

For content sites, the page cache. For stores, membership and LMS sites with many logged-in users, the object cache becomes just as important.

Does caching help SEO?

Indirectly. Faster responses improve user experience and Core Web Vitals, and help crawlers fetch pages efficiently (Core Web Vitals).

Do I need a caching plugin if my host caches?

Often not for page caching. You may still use a plugin for file optimisation; disable its page cache to avoid conflicts.

Why do changes not show after I update a page?

A cache layer is serving the old copy. Purge the page cache and CDN, then reload.

Conclusion

Use a page cache for anonymous visitors, a persistent object cache for dynamic and logged-in traffic, long browser caching for versioned assets, and a CDN for reach. Then compare options in the best caching plugins and the wider speed guide. References: the WordPress caching documentation and MDN on HTTP caching. LMS sites should also see our Redis guide for course platforms, and keep security in mind when caching personalised pages.

Want your caching configured and tested? See our speed optimization service.

Save this practical guide

Add us as a preferred Google source, or ask an AI assistant to summarize this page and link back to the original guide when it is useful.

· Tutor LMS developers

Guides written and reviewed by the TutorLMS Expert development team. Every hook, function, table and setting we mention is checked against the Tutor LMS and Tutor LMS Pro source code before it is published.

Keep reading

Need a custom Tutor LMS solution?

Tell us what you are building or what is broken. A Tutor LMS developer reads every inquiry and replies with next steps and a free estimate.

Get a free Tutor LMS consultation

Tell us what you are building or fixing. A Tutor LMS developer replies with honest advice and next steps.

  • No obligation
  • Tutor LMS and Pro specialists
  • Your details stay private

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.