开发者

Jquery AJAX Simultaneous and Long-Running Requests

I am using jQuery to loop through a large table (1,000 rows) and for each row I make an AJAX call to process some information and update a database. It takes roughly 30 minutes to complete this entire process and I use a jQuery UI progress bar to provide visibility into the processing status.

I'd like to be able to launch several of these types of long-running processes but am finding that thes开发者_如何学JAVAe subsequent AJAX processes seem to be queued until the previous long-running request is complete.

I've read on this forum about browsers limiting the number of concurrent AJAX sessions so this may be what I'm up against here. I'm curious to learn how others address running these types of long-running AJAX calls.

Waiting for 30-minutes before I can launch my next AJAX request doesn't really work for me :)


If you need lots of requests to the same server, you'll have to use subdomains. For example, instead of just pointing www.domain.tld to your application, point *.domain.tld to it (or any other wildcard subdomain). When making your AJAX requests, simply use <randomstring>.domain.tld as the host to circumvent the max. connections per server limit.

Another solution would be sending short-running requests which just start your long processes an keep one long-running AJAX request which will respond with status updates to any of your runing processes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜