Day 13 of⚡️ #30DaysOfWebPerf ⚡️
What is HTTP/2 and what can it do for us for performance?
With HTTP/1.x, we could only open up 6 TCP connections at once to download 6 resources at once. This is why we often bundled our JS or CSS into a single, large file.15:09 PM - 25 Nov 2019
With HTTP/2, we get several benefits.
First, multiplexing allows our browser to stream multiple resources at once over one TCP connection. Instead of 6 simultaneous downloads, we can theoretically download, for example, 100s at once. We're still limited by bandwidth though.15:09 PM - 25 Nov 2019
This allows us to "squish" our network profile, effectively loading faster just due to latency.
Another benefit of HTTP/2 is header compression. It might not seem like much, but when you're requesting 60 different resources, the numbers can add up.15:09 PM - 25 Nov 2019
How do we start using HTTP/2? For many static site or CDN hosting vendors, you first request an SSL certificate, and then enforce HTTPS. Some vendors will do this for you automatically. SSL certs are much easier to get now, and usually free.15:09 PM - 25 Nov 2019
Some great resources for better understanding HTTP/2 and browser networking:
HTTP/2 Prioritization by @patmeenan
calendar.perfplanet.com/2018/http2-pri…
High Performance Browser Networking by @igrigorik
hpbn.co15:09 PM - 25 Nov 2019
Discussion