Caching

WordPress Caching Explained: Page, Browser and Object Cache

Understand the main WordPress cache layers, how to protect account and checkout pages, when to purge content and how to verify that caching works correctly.

The short answer

Caching means reusing a prepared result. Page cache stores HTML, browser cache keeps assets near the visitor, and object cache can reuse internal data or calculations. The right policy depends on the request and whether its content is personal.

Picture one real request before choosing settings

A public article may be read thousands of times. For each request WordPress can assemble settings, content and templates into HTML. If the same response remains valid for the next visitor, a prepared copy can avoid some repeated work.

Now consider an “My orders” page. Its response depends on the person who is signed in. A copy that is correct for one customer is wrong for another. The first caching question is therefore whether a response may be shared at all, not how many minutes it should be stored.

For each important route, note whether it is public or personal, how often it changes and which event invalidates a stored copy. This small inventory is the foundation for a sound cache policy.

What does each cache layer store?

Page cache holds the output of a page and can reduce the work of generating public HTML. Browser caching is commonly directed by HTTP headers; it keeps CSS, JavaScript and images available for later visits on the same device.

Object caching works with internal application results and data. Persistent storage may require suitable infrastructure. Turning on a checkbox without confirming host support does not mean a reliable object cache is operating.

Multiple layers can be useful when each has a clear responsibility. If new CSS appears with old HTML, or the reverse, the layers may be invalidated differently. Draw a simple map of browser, edge, server and application caches.

Identify login, cart and checkout routes first

Find the account, cart, checkout, payment callback, quiz and dashboard routes in your actual project. Custom URLs may not match a generic exclusion list. Responses to requests that modify data should never be replaced with a shared cached page.

Use two separate test accounts on staging. Let one person sign in and open private content, then let the other visit the same URL. Each must see only their own information. Use synthetic data for this check.

Cookies, URL parameters and headers can affect the response. At the same time, creating too many cache variations may lower effectiveness. Document exclusions so the next maintainer understands why they exist.

Purging is part of publishing

Edit an article and check whether its new title appears on the article page, archive and homepage. Purging only the article URL may leave related listings stale. Map the pages that need to change when content is published or updated.

Apply the same reasoning to course access, product stock and redirects. A cached response may remain technically valid by age while already being wrong for the visitor. Choose invalidation events that follow the actual content workflow.

When testing, distinguish a cold response after purge from a warm response after the cache has filled. Keep a short record of which event caused the purge and how you confirmed it.

How do you know the cache is correct?

Compare repeated requests to a public page and inspect the response headers or diagnostics supplied by your caching layer. A faster second request alone is not enough evidence: browser storage and network differences may also affect timing.

Then test a signed-in page and a checkout flow. Check that private data never crosses accounts and that forms still submit correctly. A cache hit is only useful when the returned content is current and authorized.

Finally update a public page, verify dependent pages, and repeat after a deployment. If a setting makes the result hard to explain or reproduce, simplify the policy before increasing its reach.

Action checklist

Check items as you work. Your selections last only while this page is open.

Common questions

Is object cache the same as page cache?

No. Page cache stores a rendered response; object cache reuses internal application data. They solve different parts of the request path.

Should every page be cached for the same duration?

No. A public article, cart and student dashboard have different freshness and privacy requirements. Define rules by content and user state.

Sources and further reading

The technical references below support this guide. Its implementation scenarios are examples; measure outcomes on your own site.