Wednesday, March 18, 2015

HTTP2 will mean a change in how we should build websites

HTTP2 will mean a change in how we should build websites. The best practices of HTTP1 are harmful in a HTTP2 world.

HTTP1 is slow and inefficient for the majority of today's use cases on the web.
HTTP1.x is the version of HTTP we are all familiar with. It's an old protocol that was designed before we knew what the world wide web would become. While it does the job, it's just not very efficient at it anymore because what we demand of it is quite a lot more complex than what it was designed for.

To get websites to load in an acceptable time using HTTP1 we have developed a series of techniques; hacks really; to eke performance out of this old protocol. 

They are:

Spriting: taking multiple images, combining them into one image, and using CSS to only show part of that image in a particular place.

Concatenating: Taking multiple CSS or JS files and sticking them into one large file.
Serving assets from a cookie-less domain.

Sharding: creating different domains or sub-domains to host assets like images.