0

I have a server which has multiple REST endpoints which I want to query in parallel with Javascript. I try to query e.g. 10 endpoints at the same time. However, chrome only allows to execute 6 queries at the same time which is documented here. So my waterfall diagram looks like the following: enter image description here 6 requests are executed in parallel while the rest is stalled. I want to disable the stalling. How can I do that? I am using the latest Version of Chrome ( 75.0.3770.100) and I tried multiple values for the Cache-Control Header field which I found here - non of them worked:

max-age=3, must-revalidate

enter image description here

no-cache, no-transform

enter image description here

no-store

enter image description here

Any ideas how to solve this problem? Here is my test code with which I generate the requests:

<html>
 <head>
<script
  src="https://code.jquery.com/jquery-3.4.1.min.js"
  integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
  crossorigin="anonymous"></script>
<script>
let i=0;
while(i<20){
  $.ajax({url: "http://127.0.0.1:9998/abc", headers:{
    'Cache-Control':'no-store'
  }, success: function(result){
    console.log("done");
  }});
i++;
}
</script>
</head>
<body>
</body>
</html>
user3579222
  • 1,103
  • 11
  • 28

1 Answers1

0

Two possible options are:

  • Use HTTP/2.0. With HTTP/2.0 just a single connection is used, but the requests and responses are multiplexed. The result is that all request can be sent at once, the server executions several ones in parallel and starts further ones before the previous responses have reached the client.

  • Use several hostnames: The limit of 6 concurrent connections is per host. If you use several hostnames, you can execute more than 6 concurrent requests.

Codo
  • 75,595
  • 17
  • 168
  • 206