What this thread does
Do first: set Cache eligibility: Bypass cache for authenticated routes and real session-cookie requests, after broader cache rules, before purging stale objects.
Short answer
As of November 2026, use current Cloudflare Cache Rules docs. Separate public assets from login/account/cart/API responses and session-bearing traffic. A Status code TTL setting can result in Cloudflare removing Set-Cookie and caching the asset. Preserve origin private/no-store and explicit request bypass boundaries. Cookie behavior, origin directives.
Choose / don't choose
- Bypass: choose for auth callbacks, login/account/checkout and responses personalized by cookies or authorization; don't assume session cookies separate shared entries. Match real auth mechanisms. Login guidance, cookie rule.
- Eligible public content: choose only responses identical for all matching visitors; don't use whole-host caching without exclusions. Settings.
- Targeted purge: choose when affected URL/variants are known; don't flush unrelated objects for one stale page. Fix eligibility before purging. Purge scope.
Not for: general origin cache-header selection; see cdn-serves-old-page-or-another-users-page-cache-control-headers.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
Cache eligibility | Bypass cache on sensitive paths/session requests | Current Cache Rules | Settings |
Edge TTL / edge_ttl.mode | Use cache-control if present, bypass if absent = bypass_by_default on eligible public paths; preserves prohibitions | Current Cache Rules | TTL settings |
edge_ttl.mode | respect_origin follows present directives, uses default behavior if absent; avoid override_origin for personalized responses | Current Cache Rules | TTL settings |
Browser TTL / browser_ttl.mode | Respect origin / respect_origin; don't override private-response policy | Current Cache Rules | Browser settings |
http.cookie expression | Documented expression uses http.cookie contains "test-cookie"; the expression is shown using the Expression Editor | Current Cache Rules | Cookie example |
Origin Cache-Control | private, no-store on private responses; With Origin Cache Control on, no-cache caches and always revalidates | Current origin/HTTP behavior | Directives |
Purge request files | Full URLs; include custom-key header variants; purge_everything: true only for zone-wide need | POST /zones/{zone_id}/purge_cache | API |
Cache Rules stack; conflicting values use the last matching rule. Put broad caching before auth/session bypass; ensure no later rule re-enables it. Specificity alone does not win. Priority.
Order of operations
1. Compare a disposable URL anonymously and as two separate users. Capture CF-Cache-Status, Age, origin cache headers, body identity and Set-Cookie; inspect each redirect hop without sharing credentials. Statuses. 2. Compare authorized origin diagnostics with edge behavior. HIT means cached; STALE means expired content served when origin could not be reached. DYNAMIC can mean request bypass; Responses that Cloudflare chooses not to cache return BYPASS instead of MISS. MISS alone does not establish safety. Statuses. 3. Narrow public caching; add route/session bypass last. Remove overriding/status-code TTL on private paths. Cookie absence does not make login/callback HTML public. Settings, login guidance. 4. Purge polluted URLs with POST /zones/{zone_id}/purge_cache and {"files":["https://example.com/account"]}. Include custom-key headers/variants. A redirect purge leaves its destination cached. Prefer prefix/tag scopes when variants cannot be enumerated; purge everything only for a broad incident. API, limitations. 5. Repeat separate-user and anonymous requests; require correct private bodies and cookie preservation on every hop. Inspect browser, service-worker and origin caches separately if staleness persists.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
HIT with missing Set-Cookie | Status code TTL setting can remove Set-Cookie and cache the asset | Bypass auth paths, remove override and purge polluted entries; investigate possible cross-user reuse | Cookie contract, login diagnostic |
Unable to purge, rate limit reached. | Purge API throttled | Back off and throttle requests; correct URL/variant scope before retry | API errors |
teknovision's April 20, 2026 APO report describes missing cookies on redirects despite a bypass rule. Its proposed implementation cause is a reporter hypothesis, not an established explanation for all cache failures.
Missing
- Real auth paths/cookies, custom keys, browser/service-worker policies and Workers/APO presence are unspecified. One cache header cannot establish absence of cross-user exposure.
Checked
2026-11-12; current docs, November 2026. Sources read: linked settings/order/cookie rule, cache/origin/cookie behavior, login troubleshooting, purge guide/API and teknovision report. No rules, purge or application requests executed.
Started from a post by @Cloudflare, packaged by the editor. Original post