Probeo
probeo

How to Fix CF-Cache-Status Header | Probeo

The CF-Cache-Status header reveals that the response was served through Cloudflare. This page explains why the header leaks infrastructure information and how to remove it.

The CF-Cache-Status header is added automatically by Cloudflare to indicate whether a response was served from cache. The header discloses that the site is using Cloudflare as a CDN or proxy. This information is visible to clients, crawlers, and anyone inspecting HTTP traffic.

What's Happening

The response includes a CF-Cache-Status header. This header is set by Cloudflare and indicates the cache state of the response. Common values include HIT, MISS, EXPIRED, BYPASS, and DYNAMIC. The header is visible in HTTP responses and confirms that the request passed through Cloudflare infrastructure.

Why It Matters

The header identifies the specific CDN or proxy service in use. This narrows the attack surface by revealing infrastructure choices. Attackers gain insight into caching behavior, which can inform cache poisoning attempts or timing-based analysis. The disclosure also provides unnecessary detail to competitors and auditors. Infrastructure decisions should not be publicly documented in response headers.

The Correct Change

  • Remove the CF-Cache-Status header from responses before they reach the client.
  • This can be done using Cloudflare Transform Rules or Workers. Create a rule that removes the header on outbound responses.
  • Alternatively, configure the origin server or an intermediary proxy to strip the header if Cloudflare configuration is not accessible.

Verification

  • The CF-Cache-Status header is absent from all HTTP responses.
  • Other Cloudflare-specific headers such as CF-RAY are also reviewed for removal.
  • The response headers do not disclose infrastructure or caching implementation details.

Takeaway

  • The CF-Cache-Status header discloses that Cloudflare is in use.
  • The header provides information about caching behavior visible to all clients.
  • Infrastructure details should not be included in public HTTP responses.
  • Removal requires configuration changes at the Cloudflare or origin level.

FAQ

What does CF-Cache-Status reveal?
It confirms that the response was served through Cloudflare. It also indicates whether the response was cached, bypassed, or dynamically generated.
Can the header be removed without affecting caching behavior?
Yes. The header is informational. Removing it does not change how Cloudflare caches or serves responses.
Are there other Cloudflare headers that should be removed?
Yes. CF-RAY, CF-Request-ID, and Server headers set to cloudflare also disclose infrastructure details and should be reviewed.
Does removing the header improve security?
It reduces information disclosure. Attackers have less detail about infrastructure and caching logic. This does not eliminate vulnerabilities but reduces reconnaissance efficiency.
Can the header be removed using Cloudflare Transform Rules?
Yes. Transform Rules allow modification of response headers. A rule can be created to remove CF-Cache-Status on all outbound responses.
Should staging environments also remove this header?
That depends on operational needs. If staging environments are publicly accessible or shared with external parties, the header should be removed. Internal environments may retain it for debugging.