Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gzip compression for HTTP 1.0 proxy requests on Azure Web Sites

Is there any way to get Azure Web Sites to serve gzip'ed content for requests from a HTTP 1.0 proxy like Amazon Web Services CloudFront? Consider a request like this:

curl -I -H "accept-encoding: gzip,deflate,sdch" -H "Via: 1.0 {foo.cdn.net}" -0 http://{fooproject}.azurewebsites.net/

It seems that the general way to accomplish is to add the following element to system.webServer:

<httpCompression noCompressionForHttp10="false" noCompressionForProxies="false" />

It also seems that httpCompression is only valid in ApplicationHost.config and not web.config which means that it's not overwriteable on Azure Web Sites.

Any suggestions for workarounds?

Additional resources:

  • Serving Compressed Files with CloudFront
  • Tweaking Windows Azure Web Sites
like image 267
friism Avatar asked Nov 13 '22 15:11

friism


1 Answers

IIS won't compress for HTTP/1.0 requests. You can override this behaviour by setting:

appcmd set config -section:system.webServer/httpCompression /noCompressionForHttp10:"False"

like image 84
ianbeks Avatar answered Nov 15 '22 06:11

ianbeks