2

I have an application that makes several XMLHttpRequest's per second. All requests are to the same script on my server. I noticed in chrome developer tools that the 'blocking' time exceeds 5 seconds on most requests.

I wanted to know if it was possible to force a new connection rather than have the client wait for the already established connection to become available.

I'm using jQuery.post to make the XMLHttpRequest call.

4
  • 1
    Why are you making so many requests?
    – gen_Eric
    Commented Feb 29, 2012 at 21:01
  • The reason is irrelevant to the question. It's a proprietary application that needs up to the second data returned for a large amount of queries. Commented Feb 29, 2012 at 21:03
  • 1
    I don't think it's irrelevant. There may be a better solution that doesn't involve an AJAX call every second.
    – gen_Eric
    Commented Feb 29, 2012 at 21:08
  • There is a perfectly good reason why the requests are being sent so frequently and in such great numbers. Basically it's an application that scan's eBay for newly listed items that fall within a price range using their API. Items are sometimes listed way below market value and are bought almost instantly. The application needs to make these calls as fast as possible and as frequently as possible to catch these listings the moment that they are listed. Commented Feb 29, 2012 at 21:26

1 Answer 1

1

Browsers are limited to a number of connections per host name. I guess you are hitting that number.

If you need up to date values, maybe you should look at sockets or COMET style polling.

Not the answer you're looking for? Browse other questions tagged or ask your own question.