HTTP2: a faster and more secure web//
In the past year, talk of HTTP2 has gone hand-in-hand with the talk that all websites should have a SSL certificate and be using a secure HTTPS connection. This is mainly down to Google favouring sites that use HTTPS in search results. To explain what HTTP2 is, I think it’s best to explain HTTP (Hypertext Transfer Protocol) first…
HTTP explained
HTTP is the protocol we’re currently using. It has been around since the start of the web and, version HTTP 1.1, came out in 1999 and has been widely used up until recently.
Websites in 1999 looked a lot different to the websites we have today. There was no responsive design, very little CSS or JavaScript, and a typical website consisted of HTML and images, meaning the size was smaller too.
When you request a website from your browser using the current HTTP protocol each resource, by which I mean every image, CSS or JavaScript file, is requested 1 at a time. This means a large image file could slow down the loading of the other files, which in turn slows down the loading speed of the website.
Websites over the years have gotten bigger and bigger, and now need to do a lot more, which means HTTP is not very efficient in delivering websites.
HTTP 2 explained
In 2009 Google shared a research project that they had been working on called SPDY (Speedy). SPDY was not a new protocol, just a modified way of how the existing HTTP requests and responses were sent.
SPDY addressed some of HTTP 1.1’s short comings with modern websites, these were:
- to allow multiplexing – which means that multiple files can be downloaded at the same time, which improved the loading speed of websites
- to allow browsers to prioritise assets so that resources vital to the display of a page could be sent by the server first
- to compress and reduce HTTP headers – which helped to speed up how fast websites were able to download in browsers
- and to implement server push, whereby a server can push vital resources to a browser before being asked for them
SPDY was successful, and has been built upon to become HTTP 2. In February 2015 the final spec was approved with excellent browser support. Please note that HTTP2 is browser and server side, so it is best to check that your hosting provider can support it.
Google Benefits
HTTP2 is what all websites should now be using seeing that it has been backed by Google, who are pushing all sites to become faster and use HTTPS. If your site already uses HTTPS then you are more than likely already using HTTP2. You can check using this tool: https://tools.keycdn.com/http2-test. We here at Factor 3 use it on all websites that we build.
If you are one of the few left to update your site to a HTTPS connection you can learn what it is, and why you should have it by reading my other blog post > HTTPS: What it is and why your website should have it