smallroomsoftware.com

Carson Workshop Summit - The Future of Web Apps

Posted on February 02, 2006

Next Wednesday I'll be in London at the 'Future of Web Apps' summit. There will be 800 attendees (which I think is an increase on the original 500), and you can check out some of them in advance! It should be good. I'm hoping for some nice insight into the world of flickr, google, yahoo, delicious etc. Kim is coming along too which I am glad about although I have yet to totally convince him we aren't headed for a sales pitch!

Limit on number of simultaneous AJAX requests

Posted on January 24, 2006

Unfortunately, there is quite a low limit on the number of simultaneous connections that a web browser will/should make to a single server. In the HTTP 1.1 spec, the limit is just 2 simultaneous connections. From an efficiency standpoint this makes sense, but I've run into a problem coding the object details pages for FlyMine as they now do something a little bit unusual - the page displays results for several database query operations that may each take up to say, 10 seconds to run. I want the page to display immediately (allowing the user to read the rest of the page or navigate away) and for the results of the long running queries to 'trickle' in over the next few seconds. So when the page loads, an AJAX request is made for each query, pulling the results from the server and placing them in a hidden div.

The problem I have is that other parts of the page also make AJAX requests in response to user interaction and these elements won't function if my background queries (of which there are 5 or 6) aren't done (presumably because the browser is queueing the connections).

A possible solution would be to queue all the database query requests so they only take up one connections. Might even be possible to use a keepalive connection for that. Not too sure though.

Alternatively, maybe I'll bundle all the database query requests into a single AJAX request and update multiple divs with the response HTML - that's more complicated that I would like though.

Internet Explorer and Connection Limits

Clients that use persistent connections SHOULD limit the number of simultaneous connections that they maintain to a given server. A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy.

RFC2616 HTTP 1/1


Update (3/3/06): So I implemented my queueing scheme, firing off each AJAX request as the previous one finishes. You can see an example by visiting a gene page on FlyMine. Scroll down quickly (you may have to be quite quick to catch it) to see the pulsing square blobs on the left-hand side. They pulse until their associated request finishes, and then, one at a time, they turn into a little disclosure icon and fill in the number of results for each sub-query on the page. You can find the JavaScript used somewhere in the HTML source.

Hosting by site5.com