Home Software Consultant

Facebook, irctc, keep-alive, performance


Many people are frustrated with irctc.co.in. The site has become excruciatingly slow! And booking a ticket is a test of patience. Not only that, sometimes you end up getting server error during the process of booking. One of my friends shared his frustration on facebook. I decided to do some research. First, I looked at the response headers and found - Connection:close Content-type:text/html;charset=Shift_Jis Date:Sun, 25 Nov 2012 08:01:22 GMT Server:Microsoft-IIS/6.0 X-Powered-By:ASP.NET A surprise! The site runs on IIS and is developed in ASP.NET ( the headers can be faked). The next thing I noticed was - 'connection:close'. I thought this might have adverse affect on performance since site uses https. But, apparently no. This article says

The connection will stay open while both sides send and receive encrypted data until either side sends out a "closure alert" message and then closes the connection. If we reconnect shortly after disconnecting, we can re-use the negotiated keys (if the server still has them cached) without using public key operations, otherwise we do a completely new full handshake.

Using 'connection:close', helps server to keep resources free. And, since requests are ajax based, only small amount of data is exchanged between the client and the server. I found a wonderful article which traces history of keep-alive and why it is considered as harmful. Some more resourcesTLSTCP Connection establishment