Home  »  Articles  »  ASP.Net  »

Enable Gzip compression in ASP.NET using web.config file

 Posted By : Manoranjan SahooPosted Date : 23/12/2011 03:15:47 PM Category : ASP.Net Points : 3

To speed up the performance of asp.net website we need to implement compression in our website. We can use Gzip compression for this. Now the query is how can we make our web site Gzip compressed? 

Yes, we can do this with a simple configuration in web.config file.

see below :

<system.webServer> 

<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">

<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>   

<dynamicTypes>

<add mimeType="text/*" enabled="true"/>

<add mimeType="message/*" enabled="true"/>

<add mimeType="application/javascript" enabled="true"/>

<add mimeType="*/*" enabled="false"/>   

</dynamicTypes>   

<staticTypes>

<add mimeType="text/*" enabled="true"/>

<add mimeType="message/*" enabled="true"/>

<add mimeType="application/javascript" enabled="true"/>

<add mimeType="*/*" enabled="false"/>   

</staticTypes>

</httpCompression>

<urlCompression doStaticCompression="true" doDynamicCompression="true"/>

</system.webServer>

put the above code in web.config file and it will enable the Gzip compression.

Responses
No responses found for this thread. Be the first to respond this thread.
Post Reply
Login to post Response.