Question

Okay, so we all know that most modern browsers (without tweaking) are set to 4 parallel HTTP requests at a time to a single domain/subdomain, but how does long-polling AJAX affect this?

Say I have a long-poll on a 15 second interval. While the browser is waiting for a response during those 15 seconds, does that still eat up one of the 4 parallel lines effectively making any new tabs or page loads open to only 3 parallel HTTP requests?

Was it helpful?

Solution

  1. It's not always 4, often it's 2.
  2. It is configurable to a higher number on the client side in many browsers.
  3. Yes it does eat up one of the parallel connections.

OTHER TIPS

You can have 2 concurrent requests via XHR..if you use more you might end up with unexpected results.

Use a Request Queue for more than 2 requests...each one being made after the previous one ends...

Some popular JS libraries implement a queue and can be used, or you could create one easily.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top