Performance issues with the Via header

If you are experiencing potential HTTP request performance issues, it may be caused by the Via header which we return for all requests. RFC specification for all proxies is to have this header return on every request, as such we have recently implemented this. The request header would look like this when Cloudflare sends your origin server a request:

GET / HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip
CF-IPCountry: US
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
X-Forwarded-For: 2606:4700:1000:8200:6257:18ff:fe93:ba7a
CF-RAY: 267cb1154fd92816-SJC
CF-Visitor: {"scheme" : "http"}
Accept: */*
Via: 1.1 cloudflare
CF-Connecting-IP: 2606:4700:1000:8200:6257:18ff:fe93:ba7a

The issue here being that your HTTP server doesn't know if the upstream proxy can support compressed responses. Thus by default, some HTTP servers don't serve a compressed response by default.

How to enable compression for requests with the Via header:

IIS6: Set the variable "HcNoCompressionForProxies" to FALSE like so: in the IIS metabase properties. More Info


IIS7: Set the variables "noCompressionForHttp10" and "noCompressionForProxies" to False in your server configuration. More Info


nginx: Add gzip_proxied to your configuration More Info

Apache: Apache's mod_deflate (up to and including 2.4) will compress response bodies when the Via header is present, and should therefore require no changes.

For more information about the Via header and our reasons for implementing it you can read more here at our blog. If you have any questions please submit a Support ticket for additional assistance.

Not finding what you need?

95% of questions can be answered using the search tool. This is the quickest way to get a response.

Powered by Zendesk