It is very much evident that with time the processing power increases while the available network bandwidth decrease. Http Compression is based on this basic assumption. It decreases the page size before sending the page. HTTP compression is a W3C standard that allows the server to provide a GZIP-compressed version of the HTML content to the client, at the cost of a very minor increase in CPU time. The client receives the compressed content, then decompresses it on the fly before rendering the page. Right off the bat, you can see that this is just one easy way to reduce the amount of bandwidth you use by an impressive 72% -- simply flip the switch to enable HTTP compression for your web site.
Manual Configuration is Only Necessary in IIS 6 That's right: it's only necessary to configure IIS to enable HTTP compression in IIS 6 and earlier, as IIS 7 enables static compression by default. Windows Server 2008 (which had yet to be released at the time of this writing) may offer a user interface to configure dynamic HTTP compression, but Vista's IIS Manager doesn't.
In IIS 6, the compression setting available in the GUI works; however, it only affects static content, such as HTML pages and CSS files. This setting won't do anything to compress dynamic content in ASPX pages. We must resort to editing the metabase (the IIS database for configuration and metadata storage) to deploy dynamic content compression. Here's how I got it to work on IIS 6.
- Open IIS Manager from Administrative Tasks.
- Locate the topmost sub node titled 'Local Computer'.
- Right Click on it and click 'Properties'.
- In the Internet Information Services tab, check the box titled 'Direct Metabase Edit'. (This will enable us to save changes to the IIS metabase file via Notepad.)
- Open the metabase in Notepad. For IIS 6, this is located at %SystemRoot%:\WINDOWS\system32\inetsrv\MetaBase.xml. (For IIS 5, the file is a binary file, so you'll need to download the Meta-data Edit tool instead.)
- Search for the
<IIsCompressionScheme>tag. There should be two<IIsCompressionScheme>entries: one for deflate and one for GZIP -- the two methods of compression that IIS supports. By default, IIS uses GZIP; deflate is rarely used. - Search for the HcScriptFileExtensions section. Add to the list aspx, asmx, php, cgi, and any other file extensions that you want dynamically compressed. Follow the existing format carefully -- it's return-delimited, and any extra spaces will prevent the file extensions from working. Make the same changes in both deflate and GZIP.
- Set HcDynamicCompressionLevel to level 9 (it has a default value of 0, which means "no compression"). I recommend level 9, based on several reports that I've read on the Web suggesting that level 10 requires much more CPU time, while offering only a minimal reduction in file size over level 9. Make this change for both deflate and GZIP.
- Reset IIS via running iisreset.
- Now you are good to go. To test whether your site is now using Http compression, visit the following site.


0 comments:
Post a Comment