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.