HTTP/2 is the latest upgrade for the internet offering us advantages in performance and reduction in wait times, server resource usage and network resource usage. In this article, we explain what HTTP/2 is and why you want to use it over and above HTTP/1.1, some of its advantages and some things you need to consider. Once we get past the introduction, we’ll talk about how we can support HTTP/2 in Azure-hosted websites.
HTTP/2 is the latest upgrade for the internet offering us advantages in performance and reduction in wait times, server resource usage and network resource usage. In this article, we explain what HTTP/2 is and why you want to use it over and above HTTP/1.1, some of its advantages and some things you need to consider before thinking about using it.
Once we get past the introduction, we’ll talk about how we can support HTTP/2 in Azure-hosted websites.
If you run a website then performance is one of the key metrics that you must consider: how does the site perform for end-users accessing the page; how many connections the website can handle at once (concurrent connections) before things start to go a bit haywire; how does the load generated by end-users impact the performance of the server and more. For a long time now, the web has relied on HTTP/1.1 as a protocol for delivering content to end-users.
What is HTTP/1.1?
HTTP/1.1 has several limitations which affect the end-user experience. We can mitigate some of these with clever website design practices but it all boils down to a workaround. Ever-growing and increasingly complex site designs and architectures push the boundaries of what HTTP/1.1 was designed for and what it was not and something had to be changed.
The main problem with HTTP/1.1 was the order in which it did its work. HTTP/1.1 works by requesting one object at a time in serial and waiting for a response before moving on to the next thing. If you have a site which is image or multimedia content rich this becomes quite apparent. This serial approach to loading not only impacts the user experience but the server too as the server can only queue so many connections at a time before it becomes choked. Worse still, each of these connections is performed over a separate connection: each connection, which uses a transport protocol called TCP, has an overhead in establishing and tearing down the connection. The more connections, the more overhead; more overhead equals slower performance.
What is HTTP/2?
HTTP/2 was first proposed in December 2014 and was approved as a new standard in February 2015. Since then, uptake of the technology has been slow. HTTP/2 is designed to replace HTTP/1.1 as the protocol of choice for web traffic due to its advantages.
- Two-way parallel connections between clients and servers
- All requests performed inside a single connection
- Reduced network usage due to a reduction in overheads
- Pre-emptive push capability when the server can predict what will be requested next
- Prioritisation of requests
The list above is not exhaustive, there are more benefits than this to HTTP/2 but this gives you a good idea as to why you should think about adopting it.
Support for HTTP/2
HTTP/2 support has existed in all the major web browsers for some time. Google Chrome has supported it since March 2016, Apple Safari since September 2017, Microsoft Internet Explorer 11 and Microsoft Edge since October 2017 and Firefox has supported HTTP/2 since January 2018. Some of the mobile browsers on specific handsets have varied support for it such as the Samsung Internet browser, however, Apple iOS devices and Google devices using the Chrome browser both support it.
HTTP/2 support does come with an interesting caveat that some may need to be wary of. HTTP/2 supports both insecure HTTP and secure HTTPS connections. All of the browsers listed above have mandated that they will only accept a HTTP/2 connection when it is made over HTTPS using a secure Transport Layer Security (TLS) connection. If the site you manage isn’t already using secure connections, now may be the time to have a look at one of our other articles, Moving to a Secure Web World and implementing this.
Azure Web Apps and HTTP/2
After explaining what HTTP/2 is, we get to the main point of the article which is discussing Azure Web Apps. Last week, Microsoft announced support for HTTP/2 in Azure Web Apps, the platform-as-a-service service for running and publishing websites without needing to maintain your own servers and infrastructure.
Right now, the feature isn’t directly accessible via the user interface in Azure but that will come soon enough. For now, accessing and enabling the feature is a little buried away. If you are feeling confident then you can take a look at the Microsoft blog post announcing supporting for HTTP/2 and how to enable it yourself at https://blogs.msdn.microsoft.com/appserviceteam/2018/04/13/announcing-http2-support-in-azure-app-service/. If you aren’t so confident in making changes to Azure Web App configurations or want to speak to us about moving to secure TLS connections for your website and enabling HTTP/2, drop us a line and we’ll be happy to help.