Pradip
Pradip

Reputation: 639

Http connection limits of webworker

Suppose my Angular application is having a webworker thread. The main thread is calling X number of async XHR calls and the webworker thread is making Y number of async XHR calls. Both the calls are going to the same server. In that case, does X + Y adhere to the total number of permissible http connection of the browser (6 for Chrome), or X and Y separately adhere to 6.

Basically by using web worker - can I get more http connections per server IP? (6 becomes 12)? Or it subjects to the same browser limit of 6?

If it's latter (same browser limit of 6) - how can I increase the limit, if any tricks for Angular application.

Upvotes: 0

Views: 1451

Answers (1)

Johnathan Le
Johnathan Le

Reputation: 713

All browsers strict maximum number of HTTP Connection per Domain is 6. If you want to reach over 6, you can do in two ways:

  1. Domain Sharding: You can create more subdomains to share the workload. Ex: you can split www.abc.com to static.abc.com for Static Files, orderapi.abc.com for Order API, etc...
  2. HTTP 2: In case you understand deeply HTTP/2 and your BE server supports HTTP/2, you can perform HTTP/2, read this article

Upvotes: 2

Related Questions