HTTP2 & Web Optimization - How to have a fast website in 2016

Few years ago, the HTTPs protocol was slower than the http, due the the initial handshake of any SSL transaction. But with the HTTP2, there are several improvements available and some rules have change when we talk about web optimization. Most of the PageSpeed tools will recommend you to use domain sharding or to combine your assets to have a website faster. But is it still true ?

The most important feature of the HTTP2 is the multiplexing, it allow to download multiple files with an unique TCP connection when we have to open a new one for each file in HTTP1.1

1) No more assets concatenation

We used to combine as much as possible our assets with HTTP1.1, that's not true with HTTP2 anymore. Because if it reduce the size of the requests done, it also make the rules for caching harder to define and could have  bad results if you don't need a part of the assets on each page of your website

 

 

2) No more domain sharding

It was already a "trick" but the domain sharding is not a part of the past. It was used to open more TCP connection than a browser was supposed to. But you will have a negative result by using it with HTTP2 because it will only require unnecessary DNS request and more if the connection is established under TLS.

But there are also rules which are still Best Pratices to have a fast website

  • Reduce DNS lookup -> store all assets on the same domain or with a CDN
  • Browser Caching
  • Minimize HTTP Requests -> cookies and query strings
  • Minimize HTTP Response -> Minify your assets