I have some static content going through a CDN. I am using IIS6's built in compression (gzip & deflate) for static content and this is working fine when I request it. However, when the CDN makes the initial request for the content, it is not being returned compressed. They therefore don't have compressed content to forward to people requesting it. (Yes this raises the issue of people requesting [the zipped] content from the CDN with a browser that can't handle the compression. - We'll put that to one side for now though)
Here's an example of requesting without the 'Via' header:
HEAD /flash/swfobject.js HTTP/1.1 User-Agent: curl/7.19.7 (i386-pc-win32) Host: localhost:9120 Accept: */* Connection: Keep-Alive accept-encoding: gzip
And it returns a compressed response:
However, if I include a 'Via' header in the request (as the CDN does) then the result comes back uncompressed:
HEAD /flash/swfobject.js HTTP/1.1 User-Agent: curl/7.19.7 (i386-pc-win32) Host: localhost:9120 Accept: */* Connection: Keep-Alive Via: 1.1 220.127.116.11:80 (Footprint 4.5/FPMCP) accept-encoding: gzip
Yes these demos use 'localhost' in the request. I get the same result using the actual domain name from various machines on various networks though.
Two questions then:
1 - Could this be IIS not applying the compression due to the extra header? and if so what can I do about it?
2 - How can I tell if the proxy is decompressing the content before returning it?
Bonus question 3 - What can I do to investigate this problem further?
I am aware of SO question 332049, but that has the header in the response, not the request.