Facebook, irctc, keep-alive, performance

Many people are frustrated with 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 –

Date:Sun, 25 Nov 2012 08:01:22 GMT

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 resources
TCP Connection establishment


Stumbled On Python Libraries

I am making a list of libraries which I discover while reading blogs, mailing lists, etc. and feel can be useful.

1. Requests An inspiring library, already used in many small python scripts.

2. django-mediagenerator asset manager. Better are django-compressor and django-pipeline

3. Wappalyzer The blurb says “Wappalyzer is a browser extension that uncovers the technologies used on websites. It detects content management systems, web shops, web servers, JavaScript frameworks, analytics tools and many more.”