WordPress Caching Explained: Page, Browser, Object, Opcode, and CDN Caching

WordPress caching is not one thing. A site may use page cache, browser cache, persistent object cache, PHP OPcache, and CDN or edge cache at the same time. Each layer stores something different and removes a different kind of work.

The safest setup is to give each cache layer one clear owner. Do not turn on three tools that all rewrite page cache, minify the same files, or purge the same URLs without knowing how they interact.

Page cache stores finished HTML

Without page cache, a public WordPress request may load PHP, WordPress core, active plugins, the theme, settings, and database content before it renders HTML. Page cache stores the finished response so later visitors can receive it without repeating most of that work.

This is why page cache can make a dramatic difference on blogs, news sites, documentation, and other public content. It reduces PHP and database load and can lower TTFB during traffic spikes.

Dynamic pages need care. Cart, checkout, account, preview, and logged-in views may need exclusions or cookie-aware rules. Read the page-caching guide before applying a blanket rule.

Browser cache stores files on the visitor’s device

Browsers can keep static files such as CSS, JavaScript, images, and fonts based on HTTP caching headers. On a repeat visit, the browser may reuse a local copy instead of downloading the file again.

Long cache lifetimes are useful for versioned static assets because a new filename or query version can be issued when the file changes. HTML often needs a shorter or more controlled cache policy because content can change more often.

Browser cache saves network work for that visitor. It does not reduce the cost of generating an uncached page at the WordPress origin.

Persistent object cache stores reusable WordPress data

WordPress has an object caching API. By default, cached objects live only for the current request. A persistent object-cache drop-in can store reusable data in a service such as Redis or Memcached across requests.

This can reduce repeated database reads and improve uncached or logged-in paths. It is useful on many stores, membership sites, multisite networks, busy admin areas, and database-heavy sites.

Persistent object cache does not store the full HTML page. It is not a replacement for page cache. See the Redis guide for when it helps.

PHP OPcache stores compiled PHP bytecode

PHP code normally has to be parsed and compiled before it runs. OPcache keeps compiled bytecode in memory so the server can reuse it for later requests.

This cache happens below WordPress. It does not know that one page is an article and another is a product. It simply reduces repeated PHP compilation work.

Most modern WordPress hosting should have OPcache enabled. If you manage your own server, check its status and memory use instead of assuming it is active.

A CDN can cache static files near visitors

A content delivery network keeps copies of static assets in locations closer to visitors. This can reduce network distance and remove traffic from the origin server.

Some CDNs can also cache full HTML at the edge. That begins to overlap with page caching, so purge rules, cookies, query strings, and dynamic exclusions become more important.

Our WordPress CDN guide explains the difference between static delivery and full-page edge cache.

Server cache and reverse proxies

Hosting platforms may use Nginx FastCGI cache, Varnish, LiteSpeed cache, or another reverse proxy in front of PHP. These systems can serve cached pages before the request reaches WordPress.

If the host already owns page caching at the server layer, a second page-cache plugin may be unnecessary. A plugin may still be useful as the control panel for purge rules, but you need to know which layer actually serves the hit.

The WordPress WP_CACHE constant is not a cache by itself

WordPress documentation makes an important distinction: setting WP_CACHE to true does not automatically turn on Redis, browser caching, or a page cache. It tells WordPress to load the advanced-cache.php drop-in early when one exists.

A persistent object cache uses a different object-cache.php drop-in. These are separate mechanisms. Seeing WP_CACHE in wp-config.php is not proof that every cache layer is working.

Transients may live in the database or object cache

The WordPress Transients API stores temporary data. Without a persistent object cache, transients commonly live in the database. With a compatible persistent object cache, transient data can be stored in the external cache instead.

This is one reason object-cache status changes the behavior of database-heavy sites. It is also why deleting all transients is not a universal performance fix. Well-designed transient data will be regenerated when needed.

Cache hits matter more than cache checkboxes

A cache can be enabled and still miss most requests. Query strings, cookies, device variations, frequent purges, short TTLs, or broad exclusions can keep the hit rate low.

Inspect response headers or host tools to verify hits and misses. Compare TTFB between a known hit and a miss. If every public request is a miss, fix the cache policy before adding another cache product.

Purging too much can make a fast cache look slow

Some WordPress plugins purge the whole page cache after every content change. On a large site, that can leave many pages cold and force PHP to rebuild them during the next wave of traffic.

Prefer targeted purging when the cache system supports it. Updating one article may require purging that article, related archives, and the home page, but not every URL on the site.

Do not cache private content as public

The largest caching risk is serving one user’s private or personalized content to another user. Never apply public full-page cache rules to account pages, checkout, carts, private dashboards, or pages that vary by authentication unless the platform is designed to separate those variants safely.

Test logged-in and logged-out behavior after cache changes. For stores, test adding to cart, changing quantity, coupon behavior, checkout, and account pages.

A simple cache ownership map

  • Page HTML: one page-cache or reverse-proxy owner.
  • Browser assets: web server, CDN, or cache plugin managing headers.
  • Persistent objects: one Redis or Memcached integration.
  • PHP bytecode: OPcache at the PHP layer.
  • CDN edge: one edge policy that matches origin cache behavior.

Once you can draw that map, cache debugging becomes much easier. If the site is still slow, use the TTFB guide to inspect uncached work instead of stacking another cache layer.

The cache key decides what can be shared

A cache needs a rule for deciding whether two requests represent the same response. The URL is part of that rule, but cookies, query strings, language, login state, and other request details can matter too. A public article viewed by two anonymous visitors may be safe to share. An account page usually is not.

Too many variations reduce cache hits because the system stores many copies. Too few variations can leak personalized content. Good caching is therefore not only about lifetime; it is also about the cache key and bypass rules.

Invalidation is part of the design

A cache is useful only if changed content becomes visible when it should. Publishing a post may require purging the post URL, its category page, the home page, feeds, and other pages that list it. Purging the whole site after every small edit is simple but can create a wave of slow cache misses.

Prefer targeted invalidation when the caching layer supports it. Then verify with response headers or a cache status tool that the page is actually a hit after it has been rebuilt. A cache checkbox without observable hit behavior is not enough.

Different layers can keep different lifetimes

A versioned CSS file can often use a long browser and CDN lifetime because a changed file gets a new URL. HTML usually needs a shorter or more active purge policy. Object-cache entries may be invalidated by WordPress when data changes. OPcache follows PHP file and server rules. Do not apply one lifetime to every layer just because the interface offers a global number.

When debugging, write down which layer produced the response. That one habit prevents a browser-cache issue from being mistaken for a WordPress page-cache problem.

Keep that cache map with the site notes.

Sources and further reading

Related FastWP guides