Choose a location:
posted 2/15/2012 by Raghav Khunger
Gzip can lead your applications to perform faster since the sizes of the files delivered to client is reduced via gzip algorithm which leads to saving of bandwidth. In ASP.NET applications you can do it via some settings web config. Below is the code which you can put in your web config in system.webServer tag
<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>
Where to put:Here is the position where you have to put the gzip settings in your web config:How to confirm:You can verify whether gzip is working for you or not by looking at the response headers in console. The Content-Encoding header will have gzip value there.
What kind of email newsletter would you prefer to receive from CodeAsp.Net? 18