Click here to Skip to main content
15,889,391 members
Articles / Web Development / IIS
Tip/Trick

HTTP Compression and Better Performance

Rate me:
Please Sign up or sign in to vote.
4.95/5 (7 votes)
5 Jul 2013CPOL3 min read 10.8K   7  
Here, I show how to know whether a website's HTTP compress is enabled or not and by enabling you can improve your application performance.

Introduction

HTTP compression technique one of the good techniques to improve performance in web based applications. Both web server and clients make better use of available bandwidth and provide greater transmission speeds between both of them.

The most common compression schemes include gzip and deflate.

Background

One of my senior developers was assigned a task. The scenario was that there were two servers, one was a development server and the other was a production(live) server. The production server was a server firm. In both servers, we deployed a web application, but the problem was when those two applications were run, the two applications show different file sizes when we observe through Firebug tool.

Details

Here, I show some pictures regarding that issue, then explain later.

Development Server

Image 1

This is the development server application files observing from Firebug. Here you see the modernizr-2.5.3.min.js file size is 7.1 KB.

And the details about those files:

Image 2

Production Server

Image 3

This is production server application files observing from Firebug. Here you see the modernizr-2.5.3.min.js file size is 14.9 KB.

When you click on that file, then you see all the details about that file request and response.

Image 4

All of the files in the production server show more than twice the size than that on the development server and loading those files in production server takes too much time.

At first, I searched in Google why the same file shows different sizes in different servers, but I did not get the desired result.

I copied the content of that file from two different servers and matched with each other and both files matched and I got the same file size, but in Firebug, it shows different sizes.

  • Is it the problem of Firebug tool?
  • Is it the problem of making the production server as a server firm?

Then, I finally tried to find out what is the difference between two files in Firebug. I saw that in the development server file, content is encoded by gzip term which was not seen in production server file. I searched in Google with that term and finally came to know that it is a compression technique which is configurable from IIS settings.

After enabling HTTP compression, all file sizes are equal in both servers and production server application loading performance is better than in the past.

Points of Interest

It's a very simple task to enable or disable HTTP compression, but it's challenging to find out when you browse an application, is it HTTP compressed enabled or disabled? This is because as a developer, you do not have permission to go the production server.

As long as I knew that file size showing in Net tab in Firebug is the actual file size, now I can understand it's not the physical file size. It's the size of data transferred from server to client browser.

Now I can easily find out whether website files are HTTP compression enabled or disabled.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer The Jaxara IT Ltd.
Bangladesh Bangladesh
I have 3+ years industrial experience mostly Microsoft technologies. My expertise areas are Software development, design, use various design pattern to real life implementation, Unit testing, Java script, Knockout JS, Dojo, Ajax, ASP.NET Webform/MVC, SQL Server, NHibernet, Entity Framework etc.

Comments and Discussions

 
-- There are no messages in this forum --