javascript 现代浏览器中允许有多少 PENDING ajax 请求?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7125682/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 23:02:33  来源:igfitidea点击:

How many PENDING ajax requests are allowed in modern browsers?

javascriptajaxbrowserxmlhttprequest

提问by DanC

First, I want to make clear that I am not talking about this question How many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?, which is about simultaneous requests.

首先,我想说明一下,我不是在谈论这个问题,流行浏览器中允许多少个并发 AJAX (XmlHttpRequest) 请求?,这是关于同时请求。

Instead, I want know if there is a limit on the number of pending ajax requests, before the browser potentially starts cancelling them or throwing errors.

相反,我想知道在浏览器可能开始取消它们或抛出错误之前,待处理的 ajax 请求的数量是否有限制。

Running some simple tests, I've seen that when the limit of about 6 simultaneous requests is hit, the browser will start queuing requests in a graceful manner. Once a 'slot' becomes available, it is used and a new request is sent to the server.

运行一些简单的测试,我看到当达到大约 6 个同时请求的限制时,浏览器将开始以优雅的方式对请求进行排队。一旦“插槽”可用,就会使用它并向服务器发送新请求。

I have also seen that Chrome, Firefox and even IE will gracefully handle a queue of about 100 requests.

我还看到 Chrome、Firefox 甚至 IE 会优雅地处理大约 100 个请求的队列。

回答by Mina Kolta

I also guess that it's indicated from maximum number of current opened connection and here's the situation in IE Max-Connectionsand this thread also may help How many concurrent AJAX requests are allowed in popular browsers?

我还猜测它是从当前打开的最大连接数表示的,这是 IE Max-Connections 中的情况,这个线程也可能有助于流行浏览器中允许多少并发 AJAX 请求?