Everything You Need To Know About HTTP/2
- The Second Major Revision of the HTTP Network Protocol
Created by The Working Group and based on Google’s SPDY network protocol, HTTP/2 is the first major improvement to the HTTP standard in almost 20 years. As of May 2015, HTTP/2 has been published as RFC 7540.
- Replacement for Google’s SPDY
Given that many of the key features of HTTP/2 are improvements on their existing (non-standard) SPDY network protocol, Google has decided to remove support for SPDY in early 2016 in favor of the HTTP/2 standard.
- A Binary Protocol
This is a switch from HTTP/1.1 which was a text protocol. By changing to binary the ease of use provided by a plain text representation is lost, but what you get is a more efficient, more compact, and less error-prone protocol.
HTTP/1.1 had a Head-of-line blocking problem where, even with the use of pipelining, a slow or large response message could block others behind it. HTTP/2 attempts to fix this by using multiplexing: the combining of separate request and response messages into a single message to later be broken down into their individual parts at the receiving end using the message header. This allows the client to make parallel requests over a single TCP connection per origin when loading a page. This is beneficial as it stops browsers from using as many of the client’s network resources as well as reducing congestion server side which in turn reduce the chances of a buffer overflow/retransmit.
- Compatible with HTTP/1.1
One of the primary goals when creating HTTP/2 was to maintain high compatibility with HTTP/1.1. As such the HTTP semantics have not been changed ensuring backwards-compatibility. Browsers will also automatically switch from HTTP/1.1 to HTTP/2 if both they and the server support it. This switch is both instant and invisible to the user.
- Beneficial to the End User
HTTP/2 is proven to have faster page load speeds, especially for encrypted HTTPS sites. Encryption is stronger with required support for Perfect Forward Secrecy for a more private, more secure browsing experience.
- Beneficial to Hosting Service Providers
Whether you provide hosting to big companies trying to increase conversion rates or small blogs looking to improve their audience retention, there is no better way to accomplish these things than by providing a smoother, faster browsing experience. HTTP/2 gets content to consumer devices more quickly, efficiently, and securely than other existing network protocols. Thus by combining the improvements brought by HTTP/2 with the speed and efficiency of LiteSpeed Web Server, you become a much more attractive hosting option.
- Available Now
If you happen to be using the latest versions of popular web browsers such as Google Chrome or Mozilla Firefox, you are already set up to take advantage of all the benefits of HTTP/2 enabled web pages. Examples of these include web sites powered by Google and all current editions of LiteSpeed Web Server.
- HPACK Header Compression
Because of TCP’s Slow Start mechanism, it is beneficial to send out as few packets as possible to reduce the total number of round trips required when loading a page. By compressing the involved message headers, what would normally take several round trips can now be done in one. This type of compression was used by default in SPDY using GZIP and optionally in HTTPS . Since then a security exploit known as CRIME has made GZIP and this type of compression unsecure. In response to this HTTP/2 uses HPACK: a new, header-specific compression scheme created by The Working Group that possesses reasonable compression efficiency while still being secure.
- Optional Encryption
HTTP/2 uses TLS for encryption but, like HTTP/1.1, does not require it. Despite this, both Mozilla Firefox and Google Chrome have stated that they will only allow HTTP/2 over an encrypted connection. These decisions in effect make encryption mandatory, facilitating more secure communication on the Web.
- Server Push
Server Push is a method of information delivery where a server pushes a resource directly to the client without first receiving a request to do so. By doing this the server can attempt to anticipate client requests and pre-push them into the client’s cache in an effort to avoid the usual request-response round trip delay.
HTTP/2 Server Support
If you would like to check a web server/site for HTTP/2 support, you can do so with the following browser extensions/add-ons:
- HTTP/2 and SPDY indicator (Chrome extension)
- HTTP/2 and SPDY indicator (Firefox extension)
- Firebug (Firefox)
For detailed information on how to use these tools to check for HTTP/2 support, try our How to check a Website For HTTP/2 Support page.
Configuring Your Site To Use HTTP/2
In order to use HTTP/2 on your site, you must first modify your site to use HTTPS.
For current LiteSpeed users with an HTTPS enabled site
If you are using LiteSpeed Web Server and already have HTTPS configured, you only need to upgrade to LiteSpeed Enterprise 5.0+ to begin using the HTTP/2 network protocol.
HTTPS Not Yet Enabled
If your site is not currently configured to use HTTPS, have a look at our short guide for Enabling HTTPS On Your Site.
For those who would rather not convert to LiteSpeed
If you do not want to convert your current web server to LiteSpeed but would still like to use HTTP/2 on your site, you can instead do this for free by setting up OpenLiteSpeed as a front-end proxy for your existing web server.
Web Servers Supporting HTTP/2
Here is a short list of notable web servers currently known to support http/2
- OpenLiteSpeed 1.3.x and 1.4.x
- LiteSpeed Enterprise 5.0+
- H2O (A new event drive webserver, not much use in production environments)
- nghttp2 (An HTTP/2 C library, the server is more like an example on how to use the lib)
- Jetty (Java Servlet engine)
- http2 (Go)
- node-http2 (NodeJS)
Full list here: https://github.com/http2/http2-spec/wiki/Implementations
- While it does support HTTP/2, Apache's mod_http2 is currently in an experimental stage.