Move to HTTP/2
Hypertext Transfer Protocol (HTTP) is one of the most ubiquitous and widely adopted application protocols on the Internet. It’s the common language between clients and servers, enabling the modern web. From its simple beginnings as a single keyword and document path, it has become the protocol of choice not just for browsers, but for virtually every Internet-connected software and hardware application.
Briefly History of HTTP & SPDY
HTTP is an old protocol, initially defined in 1991, and the last major revision is HTTP/1.1 that published in 1999. Now a days a website required to load the home page is 1+ MB average, with over 100 individual resources required to display a page. The resource can be anything, from an images or a fonts to a JavaScript or CSS file.
Protocol SPDY
Before HTTP/2, SPDY is announce in 2009, this is an experimental protocol, developed at Google, whose primary goal was to try to reduce the load latency of web pages by addressing some of the well-known performance limitations of HTTP/1.1.
Specifically, the outlined project goals were set as follows:
- Allow concurrent requests across a single TCP connection, known as multiplexing.
- Allow browsers to prioritize assets so that resources vital to the display of a page could be sent by the server first.
- Compress and reduce HTTP headers.
- Implement server push, whereby a server can push vital resources to the browser before being asked for them.
SPDY need or required Hyper Text Transfer Protocol Secure (HTTPS) connection between server and browser.
Protocol HTTP/2
HTTP/2 builds on the success of SPDY, which was used as a starting point for the new protocol. The requirement for an HTTPS connection has been dropped. That said, all of the browser vendors have decided to only implement HTTP/2 for TLS (https) connections. So while you could potentially use HTTP/2 with clear text in server to server communications, our use case of serving HTTP/2 to browsers means that you need to have your site running on https before you can even think of moving to HTTP/2.
Few fundamental changes of HTTP/2 that can benefits us:
- Multiplexing & Concurrency: all requests are downloaded in parallel, not in a queue
- Header Compression: HTTP headers are compressed with HPACK
- Binary Framing Layer: Pages transfer as a binary, not as a text file, which is more efficient
- Server Push: Servers can ‘push’ data even without the user’s request, which improves speed for users with high latency
- One Connection Per Origin: all are persistent, and only one connection per origin is required, which offers numerous performance benefits.
Study Case Dokter.ID
Right now in Dokter.ID we already impement the HTTP/2 Protocol. I do some small test using Google Chrome version 52 and using 3G Connection (200 kb/s — 700 kb/s). I compare the first, second and the third home page load (which is already do cache in image, css, javascript & fonts) the result is Dokter.ID site managed the increase SPEED by 41% in the average.