ASP.NET - regarding http compression with gzip or deflate in asp.net page

Asked By Tridip Bhattacharjee on 01-Dec-11 08:37 AM

actually i don't know anything about http compression. i search google and got many code to implement http compression for asp.net web site. i just need to know what is the advantage of using http compression. does it reduce the page size or does it help page to download on client pc much faster.

i use one http module which implement http compression the code as follows.


http://www.west-wind.com/weblog/posts/2007/Jun/29/HttpWebRequest-and-GZip-Http-Responses
http://www.west-wind.com/weblog/posts/2011/May/02/ASPNET-GZip-Encoding-Caveats

just go to the link and tell me if i use those technique then my page size will be reduce and load faster. looking for advise. thanks

Suchit shah replied to Tridip Bhattacharjee on 01-Dec-11 08:49 AM

Most user's knowledge of compression is from compressing a group of files that they download, extract, and open. But compression can also be used passively to compress documents as they are being transferred to a client's browser. Because it's a passive process, the server can reduce the size of the pages sent, therefore reducing the download time for users and their bandwidth usage.

Working the numbers helps clarify the gains. You can typically reduce an HTML document to less than half of its original size. This, in turn, halves the amount of time the client needs to download the page as well as the amount of bandwidth required. All of this is achieved without actually changing the way the site works, its page layout, or the content. The only thing that changes is the way the information is transferred.


ADVANTAGES OF DATA COMPRESSION:

Less disk space (more data in reality) (*)
Faster writing and reading (*)
Faster file transfer
Variable dynamic range
Byte order independent
 To obtain these advantages the compression and decompression must be carried out directly by writing and reading programs e.g. AS PART OF A STANDARD FILE FORMAT