2

I am trying to find out ways to increase the performance of my web application when I stumbled upon HTTP/2. On reading about it, I got to know that it has very many features to increase website performance.

Coming to the implementation part of it, I see that you only have to upgrade your browser to the latest version for it to come to use. Since my browser is already at the latest version, I see that all of my resources - CSS, JS and HTML files are served with HTTP/2. However, the data queries that I make using angularJS still use HTTP/1.1. Here are my questions.

  1. How do I get my data queries to use HTTP/2 protocol? Do I have to add an extra parameter in the header?

  2. Will HTTP/2 let go of the 6 simultaneous requests per domain limit of the browsers? Can I make more than 6 parallel ajax requests?

I use angularJS on the client side. My request go through Cloudflare to a server served by Play Framework.

InquisitiveP
  • 77
  • 2
  • 10

1 Answers1

2

If HTTP/2 is supported by both client (browser) and webserver then it will be used. There is no difference needed in your front end JavaScript - the browser will automatically use it if it can.

So I would guess your “data” queries are on a different domain to your regular queries and that domain does not support HTTP/2.

Yes HTTP/2 dramatically increases the number of parallel requests in flight. 100 in flight “streams” is a common server setting. This does however bring all interesting challenges: For example, Chrome found it had some inefficiencies to deal with when having that many requests happening at the same time and for a while there put in a limit of 6 HTTP/2 requests at a time. Also some lower priority requests (e.g. below the fold images) can use of bandwidth better used for higher priority requests (e.g. above the fold images). HTTP/2 has the concept of dependencies and priorities but not every browser uses them.

It’s a fascinating topic once you get into it.

Barry Pollard
  • 40,655
  • 7
  • 76
  • 92
  • Yes, my data queries are on a different domain. I need to find out why that domain does not support HTTP/2. Thank you so much for your help. – InquisitiveP May 08 '18 at 10:24
  • However I am not very clear on the second point. With HTTP/2 the 6 parallel requests limit of chrome will go away right? – InquisitiveP May 08 '18 at 11:24
  • Yes it does because you can send multiple requests on the same connection with HTTP/2, whereas you had to open more connections for multiple connections (that browser's limited to 6). See my answer here for more information on this: https://stackoverflow.com/questions/36517829/what-does-multiplexing-mean-in-http-2/. However, while the 6 limit is drastically increased (often to 100), it is not completely unlimited and other side affects have been seen now the limit is increased. For much more detail on this, you can check out my book on the subject: https://www.manning.com/books/http2-in-action – Barry Pollard May 08 '18 at 11:30