L-Space Design - Shrinkwrapped and Bespoke Software Development   
 Home Page 
 Customer Login 
 About Us 
 Ask A Question 
 Software Catalog 
 eBooks & Courses 
 DNN Catalog 
 Farewell Package 
 Bespoke Software 
 Useful Links 
 Customer Reviews 
 ClickBank Search 
 Privacy Policy 


Why use data compression on your web site?

By Roger Willcocks

Sales. Speed. Cost.

In today's global environment, the greatest delay in the transfer of data from supplier to consumer is network speed.

By using data compression, you are doing yourself, your clients, and everyone else on the internet a favor. For yourself, you cut your bandwidth costs, and provide improved response times. For your clients, you provide a faster experience, and better performance of other applications using their network connection, and for everyone else? Well, for them you get to help ease the flood of data currently congesting the information super highway.

How else does it help? Well, how about in improving the number of people who get to see your information? There are numerous different quotes around the web about how fast a page needs to load, anywhere from 7 to 12 seconds before a visitor decides to leave without seeing it, but they all agree that faster is better. On the other hand, the more information you provide, the better you can make your point. This leads to a balancing act on your part. Using data compression shifts that balance in your favour.

Why does compression work so well for web sites? Web site data can be compressed between 1.4 and 5 fold in most cases. The reason for this is that compression relies on repeating elements, and web sites are made up of HTML, which is verbose, and moderately repetitive.

For sites that require HTTPS [also called SSL or Secure Sockets Layer], the improvements can be even greater. Encrypting information takes memory and processor power in direct proportion to the amount of data to be protected. Compression is applied before encryption, so it can greatly ease the load on a server using HTTPS.

So, how do you go about implementing support for compression with your web site? Well in fact, that is very simple. All you need is a mechanism for compressing dynamic data, and a way of knowing which clients can decompress the data.

For ASP.NET, the mechanism is simple. You need an HTTP Handler that can compress data. To know which clients can handle compressed data, you need to examine the request header for ACCEPT-ENCODING which specifies what sort of data compression the client understands.

How to install an HTTP Handler in three easy steps

  1. Install Bandwidth Buddy
  2. Add a reference to the Bandwidth Buddy dll to your web site
  3. Add the example sections from the help file to your Web.config file

That's it. Pretty easy on the server side. The example section will work for localhost, other addresses require a license.

Points to remember when testing

  • Data compression requires HTTP 1.1.
    HTTP 1.1 is not available via proxy servers by default
  • Check data compression ratios, they should be between 1.4 and 1 in 5
  • Check what happens if no compression is specified

The author Roger Willcocks is a Microsoft Certified Solutions Developer in .NET, with experience in developing Microsoft product based solutions since 1996. Recent experience includes ASP.NET websites and web services as well as windows services and data collection applications. He is trained in MS SQL Server as well as MS Access and the .NET Framework. Roger is based in Auckland, New Zealand.

Bandwidth Buddy

This article is shareware.  Give this article away for free on your site, or include it as part of any paid package as long as the entire article is left intact including this notice.
Copyright © 2004 L-Space Design.

Pass this article on to a friend

Friend's First Name

Friend's Email Address




 Home | Login | About | Contact | Catalog | eBooks | DNN Catalog | MJFP | Forums | Bespoke | Links | Reviews | CB Search | Articles
   Valid XHTML 1.0!   Valid CSS!

ASP.NET data compression provided by L-Space Design