Updated on July 19, 2026

WordPress Cache Exclusions: What You Should Never Cache

Learn which WordPress requests should bypass page and CDN cache, how cookies and query strings change the decision, and how to test checkout, login, forms, APIs, and personalized pages safely.
WordPress cache exclusions routing checkout, login, forms, dashboards, and API requests around a page cache
Table of Contents

WordPress cache exclusions decide which requests must reach WordPress instead of receiving stored HTML. Get them right and public pages stay fast while checkout, login, forms, dashboards, and personalized content remain accurate. However, get them wrong and a speed improvement can turn into an empty cart, a failed password reset, or one customer seeing another visitor’s stale page.

I treat exclusions as part of the application design, not a list copied from a plugin tutorial. The right rule depends on what changes the response, who owns the data, and whether a reused page could expose private information or break a transaction.

This article explains the decisions behind a safe setup. It also shows how to test the result across a WordPress page cache, a host cache, Cloudflare, and the browser without switching off caching for the whole site.

The Short Answer: Exclude The Request When The Response Belongs To One Visitor

A public article usually looks the same for everyone, so full-page caching makes sense. A checkout, account page, logged-in dashboard, preview, or form confirmation depends on the current visitor or a one-time action. Those requests should not receive a shared HTML copy.

A safe WordPress cache exclusions review protects those visitor-specific requests while keeping the stable parts of the site fast.

Therefore, use this question before adding any rule:

Could a stored response show the wrong data, skip required PHP logic, reuse a security token, or hide a recent transaction?

If the answer is yes, the page or request needs a bypass. If the answer is no, keep it cacheable unless testing proves otherwise. Broad exclusions feel cautious, but they can send too much traffic back through PHP and the database.

What A Cache Exclusion Actually Changes

Most WordPress discussions use the word cache for several different systems. That creates bad fixes because excluding a URL from one layer does not automatically change the others.

Cache layer What it stores Typical exclusion decision
Browser cache Files or responses on the visitor’s device Use response directives that match how private or changeable the content is
CDN or edge cache Responses close to visitors Bypass personalized HTML, authenticated requests, and sensitive transaction paths
Page or server cache Complete HTML before WordPress runs Exclude requests that need current PHP, session, nonce, or user data
Object cache Database query results and WordPress objects Usually keep it active for dynamic pages; it is not the same as reusing full HTML
WordPress cache exclusions across browser, CDN, page cache, and object cache layers
A public page can use every cache layer, while a visitor-specific request should bypass shared HTML and still use safe object caching.

This distinction matters on WooCommerce. Cart and checkout pages should bypass shared page caching, yet Redis object caching can still reduce repeated database work while WordPress builds those dynamic pages. Disabling every cache layer would remove a useful performance tool.

The WordPress cache headers guide shows how to identify which layer answered a request. That evidence should come before a settings change.

Start With Ownership, Freshness, And Side Effects

I use three tests when reviewing a URL. First, who owns the response? Second, how quickly can its data change? Third, does loading the URL need to run application logic?

For example, a public service page has shared ownership, changes only when an editor updates it, and usually has no side effect. Cache it. An account page belongs to one user, changes after profile or order activity, and depends on an authenticated session. Bypass the page cache.

A product page sits between those examples. Its main HTML is public and usually cacheable, while stock, cart state, location, currency, or personalized prices may need controlled variations or client-side updates. The answer is not always to exclude the entire product catalogue.

Request type Default page-cache decision Reason
Public post, page, or category Cache Stable shared HTML benefits most visitors
Cart, checkout, account Bypass Session and customer-specific data must stay current
Login, logout, password reset Bypass Authentication state and one-time actions cannot use shared HTML safely
Form submission or confirmation Bypass when stateful Tokens, validation, messages, and submitted data can differ per request
Member dashboard or personalized page Bypass or vary deliberately The response belongs to a specific user or segment
Search, filter, preview, API, AJAX Review individually Parameters, permissions, and live data determine whether reuse is safe

WordPress Cache Exclusions For Login And Account Journeys

Login pages, logout actions, password resets, administrator screens, and authenticated account areas should not come from a public page cache. WordPress sets cookies to describe authentication state, and the response can change immediately after the visitor signs in or out.

A common failure appears after login. The user submits valid credentials, WordPress creates the session, but the landing page still shows the anonymous cached version. Refreshing seems to fix it because the next request follows a different cache path.

Do not solve that by excluding every page for every visitor. Confirm that authenticated cookies bypass the shared HTML cache, then check the specific post-login landing page. Membership and learning sites may also need rules for role-based dashboards, course progress, saved items, or restricted content.

Meanwhile, keep object caching separate from this decision. A logged-in dashboard can bypass page caching and still benefit from Redis when WordPress loads settings, user data, post metadata, and repeated query results.

WordPress Cache Exclusions For WooCommerce Cart And Checkout

The official WooCommerce caching guidance identifies Cart, Checkout, and My Account as pages that should remain dynamic. It also documents the session cookies that caching systems may need to respect.

For a store, the most important WordPress cache exclusions follow customer state rather than a generic list of page names.

However, those pages are the minimum, not the entire test plan. A store can use custom slugs, side carts, quick checkout, currency tools, subscriptions, product add-ons, or payment callbacks. A rule copied for /checkout/ does not protect a checkout that lives somewhere else.

Test the complete journey:

  1. Add a product from a category and a product page.
  2. Change quantity and remove an item.
  3. Apply and remove a coupon.
  4. Move from cart to checkout.
  5. Change shipping country or method.
  6. Load each payment method.
  7. Place a test order and verify the result in WordPress.

The WooCommerce checkout testing checklist expands that release check. A cache rule only passes when the business journey works, not when the checkout URL returns HTTP 200.

WordPress Cache Exclusions For Forms And One-Time Tokens

Contact forms, quote requests, booking tools, passwordless login, and payment forms often use nonces or other one-time values. If a full HTML page lives in cache longer than the token remains valid, the form can look normal while submissions fail.

That does not mean every page containing a form must remain uncached. Many modern form plugins refresh tokens, submit through AJAX, or handle cached landing pages correctly. The correct decision comes from testing the actual plugin, cache lifetime, consent layer, and submission path.

In addition, pay attention to confirmation behavior. A thank-you message, validation error, or uploaded file belongs to the current submission. It should not become shared HTML for the next visitor. Also confirm that anti-spam checks and analytics events still run after optimization.

When a form breaks only after several hours, test token age. Warm the page cache, leave it untouched, then submit from a clean browser after the normal cache lifetime or nonce window. Immediate testing can miss this class of failure.

WordPress Cache Exclusions For Query Strings And Cookies

Query strings can represent harmless campaign tracking, meaningful filters, previews, searches, cart actions, language choices, or private tokens. Treating every parameter as either cacheable or uncacheable is too coarse.

WordPress cache exclusions can target a path, cookie, parameter, user state, or a combination of conditions. The narrowest correct condition usually preserves the best cache hit ratio.

For example, marketing parameters such as common campaign tags often do not change the HTML. They can usually map to the same cached page if analytics still records them correctly. Product filters, currency, location, search terms, and preview parameters can change the response and need a separate cache key or a bypass.

Cookies follow the same principle. A consent cookie may only record a choice. A WooCommerce session, authenticated WordPress cookie, membership state, location, or test-segment cookie can change what the visitor should receive.

As a result, every unnecessary variation reduces the cache hit ratio. Every missing variation risks stale or incorrect content. Record which cookies and parameters alter the HTML, then configure the narrowest safe behavior.

WordPress Cache Exclusions For APIs, AJAX, And Webhooks

WordPress uses REST API routes, admin-ajax.php, cron requests, and plugin-specific endpoints for work that should not be treated like public HTML. These requests may read live data, update state, check permissions, receive a payment event, or return JSON.

A CDN rule that caches all paths can accidentally catch an endpoint that was never designed for shared storage. The result may be an old stock count, a repeated response, a blocked dashboard action, or a webhook that never reaches WordPress.

Instead, review custom integrations separately. A developer may add a route for a calculator, availability check, account lookup, or external system. The path can look public while the response depends on request data or authorization.

This is where WordPress development services and performance work meet. The application should state whether a response is public, private, cacheable, or variable instead of leaving the CDN to guess.

A Real Two-Request Check On Webless

I ran a clean header request twice against a recent Webless article. Both responses returned x-flying-press-cache: HIT, showing that the WordPress page cache served the public HTML. Cloudflare returned DYNAMIC, so the edge did not claim an HTML cache hit.

Next, I added a harmless cache-check query string. The page still returned HTTP 200, but FlyingPress changed to MISS. That difference is useful: the clean canonical article follows the expected cached path, while the varied request follows a separate decision.

This test does not prove that every dynamic journey is safe. It proves only that one public URL and one query variation take different paths. I would still test login, forms, cart actions, and private pages with their own cookies and state.

A good WordPress caching setup produces explainable differences. It should not force every URL through the same rule just to maximize the number of visible cache hits.

How To Verify WordPress Cache Exclusions Without Guessing

Before trusting WordPress cache exclusions in production, test one cacheable control page and every protected journey with repeatable steps.

1. Record The Current Rules

List page-cache exclusions, CDN bypass rules, relevant cookies, query handling, host-level cache behavior, and object-cache status. Screenshots or exports help when several tools overlap.

2. Choose One Cacheable Control Page

Use a public article or service page as the control. Request it twice while logged out. Confirm the expected cache status, canonical URL, content, and response headers.

3. Test Each Dynamic Journey In A Clean Session

Use a private browser with no administrator cookies. Complete the action instead of checking only the first screen. For login, verify the landing state. Confirm that a form reaches its destination. Place a test order when checking checkout.

4. Repeat As A Logged-In User

Check that account data, menus, edit links, saved items, and role-specific content update immediately. Then log out and confirm the anonymous view returns.

5. Inspect The Network Response

Compare cache headers, Set-Cookie, Cache-Control, redirects, request parameters, and final URLs. A visible success message can hide a cached response underneath.

6. Purge Only After The Rule Is Ready

Changing a rule without clearing old objects can preserve the faulty response. Purge the relevant cache layers, warm the control page, then repeat the same steps.

7. Recheck After Updates

Finally, remember that payment, membership, form, localization, consent, and cache plugins can change their cookies or endpoints. Add the journey to routine WordPress maintenance instead of treating the first successful test as permanent.

Too Many Exclusions Create A Different Performance Problem

WordPress cache exclusions protect dynamic work, but each bypass sends more requests to PHP, the database, and external services. A rule that excludes all visitors with any cookie can remove page caching for consent users, campaign visitors, or harmless preferences.

Watch the cache hit ratio, origin response time, CPU, database load, and traffic patterns after a change. If the site slows down, do not immediately remove the safety rule. Look for a narrower path, cookie, or parameter condition. Sometimes the right repair is an AJAX update or a better application cache key.

The speed optimization checklist connects cache decisions with origin performance, Core Web Vitals, conversion testing, and monitoring. Fast cached pages should not hide a weak uncached server.

A Practical Cache Exclusion Review List

  • Public pages receive the expected cached HTML when logged out.
  • WordPress admin, login, logout, and password reset bypass shared page cache.
  • Authenticated users never receive anonymous or another user’s stored HTML.
  • Cart, checkout, account, coupon, payment, and session behavior works end to end.
  • Forms use current tokens and never share private confirmation data.
  • Preview, password-protected, search, filter, language, and currency URLs have deliberate rules.
  • REST, AJAX, webhook, cron, and custom endpoints avoid accidental HTML caching.
  • Cookie and query-string variations stay as narrow as the application allows.
  • Object caching remains available where it safely helps dynamic requests.
  • Every rule has a repeatable test and an owner.

The goal is not the highest possible hit rate. It is the highest safe hit rate for public content, with dynamic journeys that remain correct under real user conditions.

When The Cache Stack Needs A Deeper Review

A simple brochure site may need only the platform defaults and a form test. A WooCommerce, membership, multilingual, booking, or heavily personalized site needs a map of paths, cookies, parameters, and data ownership across every cache layer.

Webless reviews these systems from the visitor journey back to the origin. We identify which HTML can be shared, which requests must stay dynamic, how Cloudflare and the WordPress cache interact, and whether the uncached server can handle the remaining work.

If clearing the cache fixes a problem only temporarily, the purge is hiding the rule that created it. Use the Webless contact page to request a cache and performance review. We can trace the failing journey, define the narrowest safe exclusions, and verify the result after every cache layer is rebuilt.

NOT SURE WHAT IS SLOWING YOUR SITE DOWN?

Request a WordPress Core Web Vitals report to see which loading, responsiveness, stability, and accessibility issues deserve attention first.