My website dev2qa.com uses two CDN proxies as a chain to cache my web pages. One is Cloudflare which sits in front of my website dev2qa.com, the other is Ezoic Caching which sits in front of Cloudflare CDN. But someday, I find there are a lot of unuseful response headers in the HTTP response, and I want to clarify which response header is added by intermediary proxy and which response header is added by the original web server. So I need to connect to the dev2qa.com webserver directly to bypass 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, if you want to use google chrome or Mozilla Firefox, please read the 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 the original web server, Cloudflare, or Ezoic side. The value may be combined with three parts. So our goal is to distinguish which Vary header value is added at the original web server, and which value is added at the 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 your OS to add IP domain mappings ( for example 126.96.36.199 www.dev2qa.com ) in it. Please read the 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 the web browser, the domain will be resolved to the original web server IP directly, so the communication will be passed through the original web server than CDN proxies.
- Now browse the below url in IE and use the network inspector to view the HTTP response headers, you can see the below headers ( especially the Vary header ) added by the 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‘ disappears when you view the Vary header through the intermediary proxy?
- This is because Ezoic provides a function in it’s Caching app settings, that function can let you remove any Vary header values from the upper original or proxy server.
- First, you should register as an Ezoic publisher, then login to the 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 the save button and go back, you may wait some time for the settings to take effect.