HTTPS is faster than HTTP

Secure is faster. HTTPS is the preferred way to serve web pages. The client can be sure that their sensitive info is not being sniffed by the person next to them in the coffee shop, and your site gets a cool green “check” next to the URL.The problem? With HTTPS the browser needs to do extra work, which makes the initial request slower. Despite this, HTTPS sites (can) perform better. How is that possible?

HTTPS initialization

The mechanisms needed to ensure encryption for HTTPS this is a TLS handhake. Without getting into details here, the main performance caveat is that it requires the browser to do some additional requests in order to enable the secure connection. The non-secure HTTP does not have to do this, and will get a head start when downloading and presenting the web page. Read more about this on ssl.com

As soon as the TLS handshake is done, the browser can continue just as it would with a HTTP connection. So how can HTTPS make up for the head start that HTTP gets?

Benefit #1: HTTP2

If you surf a webpage on HTTPS AND the web server supports HTTP2, you will get all the cool benefits of new protocol HTTP2, which most importantly includes wonderful performance benefits. The previous version of the protocol that we have been using for the past 10-ish ears, version 1.1, is simply not a good fit for the web landscape of today. HTTP2 is able to maximize your device bandwidth by running more requests in parallel and over the same TCP connection. Using our own site as an example, we were able to gain a decent 15% speed improvement just by using HTTPS. No extra config required!

A real-world example on how this looks something like this (courtesy of imagekit.io):

https://imagekit.io/demo/http2-vs-http1

no-alt

Benefit #2: Service workers

If HTTPS is enabled, a good portion of the browsers today can register a Service Worker for your site, and thus enable offline support. Our own site is an example of just that, and we are leveraging a Service Worker to enable faster download of assets, as well as offline support. Service Workers will not give a performance boost for first-time-users, but recurring users will get a performance boost.