My website dev2qa.com use two cdn proxy as a chain to cache my web pages. One is CloudFlare which sit in front of my website dev2qa.com, the other is Ezoic Caching which sit in front of CloudFlare cdn. But some day, i find there are a lot of unuseful response headers in the http reponse, and i want to clarify which reponse header is added by intermediary proxy and which response header is added by original web server. So i need to connect to dev2qa.com web server directly to by pass intermediary proxies. This article will tell you how to do it.
1. View Http Headers Added By CDN Proxies.
First let us view the http response headers when we connect to dev2qa.com through cloudflare and ezoic cdn proxies. I use Internet Explorer to inspect the http response headers in below picture, if you want to use google chrome or mozilla firefox, please read article How To View HTTP Headers, Cookies In Google Chrome, Firefox, Internet Explorer.
In IE inspector, we can see below http response headers.
- cf-ray : This is added by CloudFlare.
- server : cloudflare : Added by CloudFlare also.
- x-ezoic-cdn : Hit : This header is added by ezoic cdn.
- vary : This http header value can be set both at original web server, cloudflare or ezoic side. The value maybe combined with three parts. So our goal is to distinguish which Vary header value is added at original web server, and which value is added at intermediary proxy.
2. Connect To Original Web Server Directly To View Http Headers Added By Original Web Server.
- Get your original web server static ip address.
- Edit hosts file in you OS to add ip domain mappings ( for example : 126.96.36.199 www.dev2qa.com ) in it. Please read article How To Edit Hosts File In Windows 10, How To Edit Hosts File In Mac OS And Linux. After that when you input domain www.dev2qa.com in web browser, the domain will be resolved to the original web server ip directly, so the communication will be passed through original web server than cdn proxies.
- Now browse below url in IE and use the network inspector to view the http response headers, you can see below headers ( espically the Vary header ) added by original web server. Vary : Accept-Encoding, Cookie. So the Vary header’s value ‘Cookie’ is added at the original web server side.
3. Why Not Found String ‘Cookie’ When View Vary Header Through Intermediary Proxy?
- You may wonder why the string ‘Cookie’ disappear when you view the Vary header through intermediary proxy?
- This is because ezoic provide a function in it’s Caching app settings, that function can let you remove any Vary header values from upper original or proxy server.
- First you should register as an ezoic publisher, then login to ezoic dashboard, and click Caching App —> Update Cache Setting Values button, then you can enter Cookie in Vary Headers to be removed from origin input text box. Click save and go back, you may wait some time for the settings to take effect.