4

I understand all the benefits of HTTP/2, however, are there proven apples to apples comparisons to show it's speed advantage?

Akamai has a page put up for this purpose, but it seems HTTP/2 at best keeps pace and at worst is slower. I tested it in Firefox. In Chrome, HTTP/2 was slightly faster.

AngryHacker
  • 2,877
  • 6
  • 28
  • 33
  • 2
    Where in the Internet are you? This test always shows HTTP/2 as much faster for me. – Michael Hampton Apr 30 '18 at 23:54
  • 2
    The akamai page you linked seems like it rather answers your question. For the record, that page showed HTTP/2 as consistently loading 2 or 3 times faster than HTTP/1. There are lots of things that might be affecting your connection and preventing the benefits of HTTP/2. –  Apr 30 '18 at 23:55
  • 1
    It probably just depends on your internet stability at the time. If you are continuously reporting HTTP/2 as being slower your internet might not be all that stable. – gabeio May 01 '18 at 01:08
  • 1
    From New Zealand the http/1.1 loads in 13s, http 2 loads in 1.5 seconds, with 13ms latency. – Tim May 01 '18 at 01:15
  • @MichaelHampton I am in Los Angeles. From the corporate network: https://i.imgur.com/MTsjwFz.png – AngryHacker May 01 '18 at 04:48
  • @Marvin From my home network (5 Ghz wifi + 50/10 MBps cable modem). https://i.imgur.com/bvQjz0c.png – AngryHacker May 01 '18 at 04:50
  • Though on Chrome (as compared to Firefox), HTTP/2 performance is better in almost every case while Firefox beats it handily in a HTTP 1.1. https://i.imgur.com/KvmUjPM.png – AngryHacker May 01 '18 at 04:55
  • Related: https://stackoverflow.com/questions/35511737/why-is-http-2-slower-for-me-in-firefox – ceejayoz May 01 '18 at 17:26

1 Answers1

2

First of all let's verify if you are using HTTP/1.1 or HTTP/2.

Open your developer tools in Chrome or Firefox, add the protocol column and reload the page. you should see a number of images loaded from http1.akamai.com and a number from http2.akamai.com:

enter image description here

If you are not seeing HTTP/2 here then something is preventing HTTP/2 from being used (likely a proxy or anti-virus software) which might explain this. Though I see from your screenshot that "Your browser supports HTTP/2!" so I presume you are using HTTP/2 but no harm checking.

What the test does is load 378 images to make up each globe. Loading so many resources is something that HTTP/1 is particularly bad at, and which HTTP/2 is particularly good at - mostly due to HTTP/2 allowing multiplexing.

So if you are using HTTP/2 but are not seeing HTTP/2 being faster then it's likely due to one of these reasons:

  1. There is something caching the resources locally meaning you are loading them locally and not directly from Akamai. E.g. if you have a company proxy that does some caching for you. Now Akamai does set a Cache-Control: max-age=0, no-cache, no-store HTTP header on the resource so it shouldn't be cached, but still - proxies have done stranger things! to be honest loading this site in 0.62 seconds in HTTP/1 sounds too fast unless you are sitting in Akamai's data center, so this is what I think is happening. Try another HTTP/2 test (I have my own one on my blog for example).
  2. You have a super fast network with no latency. Latency is the main reason that HTTP/1.1 is slower than HTTP/2 as time is wasted sending requests back and forth, during which time no other requests can be sent on that connection. You're latency looks unreasonably low from your screenshots so you must have a super cool connection. Either that or you live next door to Akamai or are reading it locally.
  3. You are on a network with a lot of packet loss. HTTP/2 uses one TCP connection (mostly) and while that is good for most use cases, it actually gets worse on bad networks as all HTTP/2 streams are held up by a single TCP packet loss (until HTTP/1.1 where 6 independent connections can act truly independently). QUIC looks to solve that by moving away from TCP to a UDP based protocol with TCP-like reliability provided at the stream rather than connection level. But in this case I'd expect both HTTP/1.1 and HTTP/2 to be slower than the screenshots you're giving so don't think it's that.
  4. You have a sucky HTTP/2 browser. I have seen HTTP/2 implementation issues in even the most popular browsers. Try another browser. you already say this is working as you expect in Chrome but not Firefox so it may be something browser-specific. But again that doesn't explain why the HTTP/1.1 scores are sooo low.
Barry Pollard
  • 4,461
  • 14
  • 26