
HTTP/2 makes media loading 3–15 times faster on mobile - 0x7fffffff
https://medium.com/apps-and-networking/http-2-makes-media-loading-3-15-times-faster-on-mobile-a455c3e68135#.212axv7bf
======
seanwilson
Is fetching 200 image tiles really a realistic benchmark? I'd like to see
benchmarks for more realistic pages.

~~~
strommen
This demo is not realistic at all, and is pretty contrived to play to the
strengths of HTTP/2.

If your page loads stuff from 25 different domains, HTTP/2 barely helps at
all. Likewise if your page is loading MB-size image or script files. Likewise
if your server takes 2+ seconds to render the darn HTML in the first place.

But HTTP/2 is _awesome_ when all the resources come from the same domain,
because it eliminates the bottleneck of separate TCP/TLS connections. This
means you don't have to do stuff like bundling resources and sharding domains.
And indeed you shouldn't do this stuff if you're using HTTP/2.

HTTP/2's biggest problem is that nobody is changing their site to take
advantage of its benefits.

~~~
dexwiz
How websites are built is directly influenced by limitations of HTTP. Browsers
limit the number of simultaneous connections per hostname. HTTP 1.1 specifies
2 per hostname, but most browsers allow for 6, some more, some less[1]. So if
you are server a bunch of assets at once, you want to spread it across
multiple host names (usually edge servers of some sort), so you can get more
total, simultaneous connections. HTTP/2 specifically allows for all assets to
come from one host. HTTP/2 also has better negotiation on the number of
connections allowed and their direction.

These changes will see widespread use once CDNs start to take advantage of it.
If you are serving a big enough website to take advantage of HTTP/2, you are
using edge servers.

[1]
[http://www.browserscope.org/?category=network&v=top](http://www.browserscope.org/?category=network&v=top)

------
ashray
What I don't get is why the industry has decided to force encryption with
HTTP/2? The spec does not require TLS however almost every single major
browser only supports HTTP/2 with TLS.

Is this a push to make the internet more secure by design or is there some
other reason behind this?

What's the speed difference between HTTP/2 and HTTP/1.1 without TLS? I'm sure
this is hard to test because of lack of client support.

It is not always trivial to move large legacy projects to secure connections
(especially because any resource, even an image, being loaded from an insecure
endpoint results in a warning) so the result is now:

\- Support TLS first

\- Then implement HTTP/2

Consumers will not be able to take advantage of the better HTTP/2 performance
without big changes to websites to first support TLS on the server end. Why?

~~~
mholt
> What I don't get is why the industry has decided to force encryption with
> HTTP/2?

For reliability and success of the protocol. "Reasons for choosing TLS-only
include respect for user's privacy and early measurements showing that the new
protocols have a higher success rate when done with TLS. This is because of
the widespread assumption that anything that goes over port 80 is HTTP 1.1,
which makes some middle-boxes interfere with or destroy traffic when any other
protocols are used on that port." (Source:
[http://http2-explained.haxx.se/content/en/part5.html](http://http2-explained.haxx.se/content/en/part5.html))

Believe me, TLS is very much necessary in practice here.

~~~
halomru
>This is because of the widespread assumption that anything that goes over
port 80 is HTTP 1.1, which makes some middle-boxes interfere with or destroy
traffic when any other protocols are used on that port.

I'm not convinced that's a real problem once traffic leaves your servers/CDN.
In practice I have seen lots of protocols use port 80, since 80 is the port
that's most likely to be unrestricted on even the strictest corporate
firewalls.

~~~
noselasd
It's a real problem. There are plenty of middle boxes around either at
ISPs/cell operators or in residential gateways/modems that interfers on port
80.

~~~
danudey
We make mobile games for iOS and Android, and we've mostly switched to HTTPS
because of people injecting garbage (ads, mostly) into our content.

------
gubby
Ironically, this is posted on medium.com, which loads 2MB+ of static resources
to display a few paragraphs of simple text.

~~~
eyelidlessness
1\. I don't think that's irony.

2\. I see ~1.5MB on the linked page, more than half of which are images used
in the article, which are of course not simple text.

------
anderspetersson
Still waiting on Cloudfront to support it. :(

~~~
arkadiyt
Not sure why this is being downvoted - maybe people read that as "Cloudflare"
(which supports http2) instead of "Cloudfront" (which has yet to support
http2).

------
graffitici
According to the article, HTTP/2 is 6x faster on LTE, and 15x faster on 3G. Is
the result of this difference that LTE has better latencies?

~~~
tracker1
Kind of... HTTP/2's advantages depend on using push, and/or reducing prototcol
negotiation latence and round-trip time... with HTTP/2, you don't have to
negotiate a new/full TCP connection, which has overhead... also headers are
compressed. The differences in compression and push become more pronounced
with higher latencies and lower bandwidth.

At the very low bandwidth (2g/edge), the constraint goes the other way, where
you don't gain much as the channel is pretty much flooded the entire time and
the connection overhead offset is lower. ymmv.

All around, more traditional approaches can have a bigger impact... actually
optimizing images, switching to svg where practical and reducing code, markup
and stylesheets goes a long way. Reducing server response times is also pretty
crucial. If your DBMS is taking 200ms to respond to most requests, your
application is already going to be at least that slow... got multiple
requests, worse still.

Effective caching strategies are how you overcome a lot of that. There are
many pieces, and it's a matter of checking what your bottlenecks actually are,
and minimizing your content transferred first.

------
coding123
It's costing me $6 per domain per year plus 15 mins to go through the signing
process, but http 2 is worth it.

~~~
iends
Why not Lets Encrypt?

~~~
coding123
No reason, which is why I'm switching, and thanks. ;)

~~~
StavrosK
You can also consider using Caddy for TLS termination, it automatically
fetches certs and supports HTTP/2.

------
oliveralbertini
what's about battery ?

~~~
kevincox
You can finish reading and turn of your screen 3 seconds earlier so you'll
save battery.

------
qwertyuiop924
Amazing! And to think that all it cost was _all_ the transparency you could
use to debug it. And making it much harder to implement.

But seriously, as much as I like HTTP/2, it's not fully replacing 1.1 ever.

~~~
tracker1
There's nothing stopping you from using something like fiddler to make it more
transparent.

