Azure CDN - Enabling HTTP Compression - Hosted Web Role

Question

SliverNinjas on Wed, 02 May 2012 16:04:34


We are using the Azure CDN with HTTPS and QueryString support.

Using the Azure CDN, we are unable to support HTTP Compression via our hosted web role. We followed this MSDN Blog example, but it didn't change the compression behavior. For troubleshooting, we logged the IIS request headers that the CDN was relaying and discovered that the CDN Edge Servers (EdgePrism/4.0.11.3) are not passing the "Accept-Encoding" HTTP header which thus won't allow us to serve up a compressed resource. The MSDN blog also states that the edge servers are using HTTP 1.0, but our IIS logs indicates that it is served up via HTTP 1.1 protocol - telling us that we don't need the noCompressionForHttp10 and noCompressionForProxies flags anyway.

Why aren't the edge servers relaying the "Accept-Ecoding" HTTP Header? Without this header relay we cannot deliver compressed content via gzip/deflate.

Here are the HTTP Header requests that we've captured from the browser and thru the CDN to our IIS web role.

====== Browser Request Headers======

-- Chrome 18 Client Request --
Host: xxxx.vo.msecnd.net
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

-- FF 12 Client Request --
HTTP/1.1
Cache-Control: no-cache 
Connection: keep-alive 
Pragma: no-cache 
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
Accept-Encoding: gzip, deflate 
Accept-Language: en-us,en;q=0.5 
Host: xxxx.vo.msecnd.net
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 

-- IE 8 Client Request --
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: xxxx.vo.msecnd.net

====== IIS Web Role - CDN Translated Request Headers======

-- Chrome 18 --
HTTP/1.1
Cache-Control: max-age=259200
Connection: keep-alive
Via: 1.1 cds102.ord9.msecn.net (EdgePrism/4.0.11.3)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Language: en-US,en;q=0.8
Host: XXXX.cloudapp.net
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
X-Forwarded-For: XXXX

-- FF 12 --
HTTP/1.1
Cache-Control: max-age=259200
Connection: keep-alive
Via: 1.1 cds102.ord9.msecn.net (EdgePrism/4.0.11.3)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Host: XXXX.cloudapp.net
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
X-Forwarded-For: XXXX

-- IE 8 --
HTTP/1.1
Cache-Control: max-age=259200
Connection: keep-alive
Via: 1.1 cds102.ord9.msecn.net (EdgePrism/4.0.11.3)
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: en-US
Host: XXXX.cloudapp.net
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MS-RTC LM 8; .NET4.0C; .NET4.0E)
X-Forwarded-For: XXXX







Replies

Arwind - MSFT on Thu, 03 May 2012 06:55:12


Hi,

I note author Avcash has replied you at this threads form Stackoverflow, does it solve your problem?

http://stackoverflow.com/questions/10420004/azure-cdn-enabling-http-compression-hosted-web-role

Hope this helps.

Arwind - MSFT on Tue, 08 May 2012 05:47:02


Have you ever solve your problem now?

SliverNinjas on Wed, 09 May 2012 16:34:04


Arwind - this problem was solved with the workaround we discovered regarding Web Resource Handlers (AXDs).