Home Page |
Ask A Question
eBooks & Courses
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
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
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.
Home | Login | About | Contact | Catalog | eBooks | DNN Catalog | MJFP | Forums | Bespoke | Links | Reviews | CB Search | Articles