@Blog.Author(Nandip Makwana) .LearningExperience(ASP.NET, ASP.NET MVC, IIS, jQuery & Technology Surrounding it...)

November 23, 2013 comment , , ,

IIS: Enable Compression for HTTP 1.0 Request

Recently I was integrating Amazon CloudFront CDN in this blog. During the integration I found that default IIS configuration do not compress static resource when requested with HTTP 1.0. So in this quick & short post we will see how to enable static resource compression for HTTP 1.0 request in IIS.

In amazon, I have configured IIS 8.0 as a custom origin server and uploaded static resource over there. During configuration I noticed that CloudFront endpoint was serving an un-compressed static resource I was bit surprise because in CloudFront documentation, it is mentioned that it will forward request header to origin server as well response header back to requestor/client i.e. web browser here. To verify, I opened fiddler and requested static resource directly from origin server i.e. IIS 8.0. As I assumed IIS returned compressed response and appropriate response header. I was bit puzzled where to configure CloudFront to serve compressed resource as in CloudFront console I do not find any specific settings related to compression because as per documentation it was as easy as forwarding request header to origin server and forwarding response header back to requestor.

Suddenly I decided to look into IIS log and I found that Amazon CloudFront uses HTTP 1.0 to request custom origin server.

I did not expected HTTP 1.0 request here so once again I requested origin server with HTTP 1.0 using fiddler and as a surprise IIS returned un-compressed response. In IIS by default compression for HTTP 1.0 request is disabled. We need to explicitly enable compression for HTTP 1.0 request. To Enable compression for HTTP 1.0 request we need to change web.config as below.

<configuration>
    <system.webServer>
    <httpCompression noCompressionForHttp10="false" noCompressionForProxies="false"></httpCompression>
    </system.webServer>
</configuration>

After changing web.config as above, IIS started to server compressed response for HTTP 1.0. Hope this quick and short post would be helpful!

Read all post on IIS Configuration here.You can follow me on twitter for latest link and update on ASP.NET & MVC.

comments powered by Disqus

Featured Content

Resources & Tools

About Nandip Makwana

Nandip Makwana is passionate about digital world and web. He completed his Masters in Computer Application in June 2011. Currently he is working as a Software Engineer. He has shown great promise and command over ASP.NET and technologies surrounding it during his academic years and professorial life...continue reading