Skip to content
ConsultEvo

How CDN Caching Works: Read Cache Headers and Diagnose Bypasses

A CDN can serve an eligible response from distributed infrastructure instead of retrieving every response from the origin. It does not cache every page or guarantee a faster result. To diagnose a URL, first decide whether sharing its response is safe, then inspect its headers and repeat the same request under controlled conditions.

A public product image may be a suitable shared-cache candidate. A cart page that changes with a session should not be shared under a cache key that ignores that session. This guide explains how to make that distinction, interpret Cloudflare response headers, and preserve reliable request-level evidence.

What a CDN cache does, and what it does not guarantee

A content delivery network, or CDN, is distributed infrastructure that can store eligible responses at locations serving requests. When a suitable copy is available, the CDN may serve it without retrieving that response from the origin, reducing origin work and potentially shortening the delivery path. Cloudflare describes distributed caching and the distinction between commonly cached static content and configurable HTML in its cache overview.

Images, CSS, and JavaScript are commonly cacheable by default. HTML and JSON may also be cached, depending on provider behavior, response headers, cache rules, and cache-key configuration. A geographically distributed network does not guarantee that a request uses the closest facility or responds faster every time. Routing, cache state, network conditions, and whether the origin is needed all matter.

The central question is not whether a route looks static or dynamic. It is whether requests represented by the same cache key can safely receive the same response.

Decide whether a response is safe to share

A dynamic route can be a shared-cache candidate if requests represented by the same cache key receive the same response and the configuration permits reuse. Conversely, ordinary HTML is not safe to share if it contains one user’s account details and the cache key does not distinguish that user.

Before changing a rule, list every input that could change the response. Cookies, authorization, query strings, account or session state, geography, device class, and experiment cohorts are common examples. Check whether those inputs are included in the cache key or handled by a bypass. Review Cache-Control, applicable CDN-specific directives, Set-Cookie, Vary, request authorization, query-string behavior, and relevant rules.

Cookies do not universally disable Cloudflare caching, and an Authorization request header does not always force a bypass. However, authorization changes the HTTP shared-cache rules. A shared cache generally cannot reuse a response to an authorized request unless the response includes an applicable permission such as public, s-maxage, or must-revalidate. Cloudflare documents additional conditions involving Origin Cache Control, plan behavior, response headers, and request state. Its cache response guidance should be checked against the configuration being tested.

For login, account, cart, and checkout routes, default to bypass while behavior is uncertain. The application or security owner should review any proposed shared caching for these routes. Cross-session tests should confirm that one session cannot receive another session’s response.

If two users represented by the same cache key could receive different content, do not share the response until the variation is handled.

Read Cache-Control as freshness instructions, not a guarantee

HTTP cache directives describe whether a response may be stored and how freshness is assessed. They do not, by themselves, prove that a CDN stored or served the response. The definitions below follow RFC 9111, the HTTP caching specification.

  • public permits shared-cache storage in circumstances where HTTP rules might otherwise prohibit it. It does not compel a CDN to store or serve the response.
  • max-age=0 makes a response immediately stale for the relevant cache recipient. It does not prohibit storage. Reuse may require validation.
  • s-maxage=2592000 sets a 2,592,000-second, or 30-day, freshness lifetime for a shared cache. When applicable, it overrides max-age and Expires for shared-cache freshness.
  • no-store directs caches not to store the response. no-cache allows storage but requires validation before reuse. Neither is interchangeable with max-age=0. s-maxage=0 makes a shared-cache response immediately stale; it is not the same instruction as no-store.

Freshness is not physical retention. A purge, eviction, revalidation, provider behavior, or configuration can remove or refresh an object before its stated freshness lifetime ends. Read the directives together with request state and CDN rules. A long s-maxage value or public is not evidence of a cache hit.

Interpret Cloudflare cache statuses by decision point

CF-Cache-Status describes Cloudflare’s cache decision for a request, not a universal speed rating. In particular, DYNAMIC and BYPASS describe different decision points. Cloudflare’s uncached-response troubleshooting guide is useful when those values or repeated misses need investigation.

Status What it indicates Diagnostic next step
HIT The response was found in cache. Check that this request variation is safe to serve from the shared object.
MISS The response was eligible but absent at the relevant cache when requested. Repeat the same request and inspect the next status. A normal miss may populate cache for a later request.
DYNAMIC Cloudflare determined the asset was not eligible for normal cache lookup. Review eligibility, cache rules, development mode, and the request path.
BYPASS The request was treated as eligible, but the response or configuration prevented caching. Inspect Set-Cookie, cache-control directives, authorization conditions, and applicable rules.
EXPIRED An object was found but was no longer fresh and was fetched through the origin path. Review freshness directives and origin revalidation behavior.
REVALIDATED A cached response was successfully validated. Check validators such as ETag or Last-Modified and the origin record if needed.
UPDATING Stale content was served while a refresh was in progress. Check the applicable stale-while-revalidate behavior and subsequent requests.
STALE Expired content was served because the origin could not be contacted. Investigate origin availability and confirm whether serving stale content is acceptable.
NONE/UNKNOWN No recognized cache-status value is available. Capture the full response and investigate the request path and configuration.

A first MISS can be followed by a HIT, but observed results can also vary with cache state, invalidation, concurrent requests, and tiered caching. A status is evidence about that request, not proof of a general speed outcome or a complete account of every network hop.

Inspect repeated requests with headers exposed

Use a controlled request to capture response headers. Cloudflare documents this curl pattern for header inspection:

curl --silent --show-error --dump-header - --output /dev/null "https://www.example.com/images/product.jpg"

For each request, record the HTTP status, Cache-Control, CF-Cache-Status, CF-RAY, Age if present, ETag, Last-Modified, Set-Cookie, and Vary. Record whether cookies or authorization were present, but do not store their secret values. Also record the query-string state or a non-reversible query-state identifier when it affects the test.

Keep method, query string, cookie and authorization state, and test region consistent when comparing repeat requests. Note any purge or known cold-cache condition. If you need to establish whether the origin was contacted, correlate observations with origin logs. Low response time or a browser developer-tools entry alone does not prove that the origin was skipped.

The following is a proposed diagnostic record, not a Cloudflare data model. Each record represents one HTTP request. The generated observation_id identifies that request observation, so repeated requests remain separate events.

{
  "observation_id": "generated-uuid",
  "observed_at": "2026-11-24T14:30:00Z",
  "url": "https://www.example.com/images/product.jpg",
  "method": "GET",
  "test_region": "documented test location",
  "request_query_hash": "optional non-reversible query-state identifier",
  "authorization_present": false,
  "cookie_state_hash": "optional non-reversible test-state identifier",
  "status_code": 200,
  "cf_cache_status": "observed value or absent",
  "cf_ray": "observed value or absent",
  "age_seconds": null,
  "cache_control": "observed value or absent",
  "etag": "observed value or absent",
  "last_modified": "observed value or absent",
  "set_cookie_present": false,
  "vary": "observed value or absent",
  "duration_ms": null,
  "origin_log_correlation_id": "optional observed correlation or absent"
}
01Define the testThe web or platform operator records the URL, method, query state, request state, region, and known cache condition. The output is a reproducible test definition.
02Capture each requestSave the observed status and relevant headers as one request-level record. Use deterministic parsing and allowed-value checks for header fields. AI is unnecessary for this task.
03Repeat and compareRepeat under the same conditions, then compare status transitions and headers. If concurrent workers record requests, give every observation a generated event ID and enforce uniqueness for the defined observation identity. Reuse that ID only when recording a retry of the same event; separate HTTP requests remain separate observations.
04Verify and decideWhen origin involvement matters, correlate with origin logs. The platform operator owns header interpretation. Send unexpected personalized or authenticated behavior to the application or security owner before changing a shared-cache rule.

Keep request observations as an append-only diagnostic record. Store URL-level summaries separately, with a defined region, request-state class, aggregation window, metric definition, and population. If concurrent jobs update a summary, use a database uniqueness constraint and an atomic transactional upsert on the explicitly defined aggregate key. A lookup followed by create is not sufficient for concurrent workers.

Use CF-RAY and timing evidence carefully

CF-RAY is a request identifier that can help correlate troubleshooting records. Its three-letter suffix identifies the Cloudflare data center where TLS termination occurred. It does not prove that the facility was geographically closest to the user or where the request first entered Cloudflare’s network. See Cloudflare’s notes on CF-RAY location codes and geographic traffic routing.

Evidence, not a benchmark

The GoHighLevel article’s displayed timings are screenshot-specific. Its page does not provide reproducible test conditions, request state, cache state, geography, repetitions, or origin logs. Use the screenshots only to illustrate that a cache hit can avoid an origin wait in that particular test. Treat CF-RAY as a correlation clue, not a user-location or latency measure.

For a defensible timing comparison, document the URL and method, query string, cookie and authorization state, test region, device and network, cold or warm cache state, request count, response size, timing definition, cache-status sequence, and any origin-log correlation. Keep the result tied to those conditions instead of claiming a universal performance gain. The source article is an explanatory example, not a reproducible benchmark. The live page displays April 16, 2026 as its publication date; a separate update date was not independently visible.

A safe operational decision sequence

  1. Classify what can change the response, including identity, cookies, authorization, query strings, geography, device class, and experiment assignment.
  2. Inspect response headers and cache-key behavior before changing a rule.
  3. Repeat controlled requests and interpret each cache status at its decision point.
  4. Check origin logs when the question is whether the origin was contacted.
  5. Have the responsible platform operator implement an approved change, then retest and retain a rollback path.
Before enabling shared caching
  • Every response variation is identified, and the cache key or bypass behavior accounts for it.
  • Cache-Control, relevant CDN-specific directives, Set-Cookie, Vary, authorization, query strings, and applicable rules have been reviewed.
  • Cross-session tests show that one user cannot receive another user’s content.
  • A named platform owner approves the rule and records a retest and rollback plan.
  • Request observations remain separate from summaries, and aggregate keys include the defined region, request-state class, period, and metric.
  • Stop and escalate to the application or security owner if personalized content appears across sessions or a status transition is unexplained.

Measure the change using a defined set of repeat requests and, where relevant, origin-log events before and after rollout. If your team needs help documenting or improving its operational processes, see ConsultEvo’s services.