HTTPS and TLS speed: keeping the cost small

HTTPS adds a secure handshake to each new connection. Where that time goes, and how TLS 1.3, one clean redirect, HSTS and a nearby server keep it small.

IntermediateHow-to6 min readUpdated October 30, 2026

In this guide
  1. Why HTTPS is not optional
  2. Where HTTPS adds time
  3. Step 1: use TLS 1.3 and modern protocols
  4. Step 2: redirect once, on the same host
  5. Step 3: add HSTS, carefully
  6. Step 4: no mixed content
  7. Step 5: bring the handshake closer
  8. Keep the certificate valid
  9. How to measure it
  10. Check your own page
  11. Sources

Why HTTPS is not optional

TLS, the technology behind HTTPS, keeps what travels between the browser and your server private and unaltered. MDN's security guidance says it should be used for all communication, and that browsers are moving towards requiring HTTPS by default. Many web features can only be used in a secure context. HTTP/3 always uses TLS, and the usual way to run HTTP/2 is over TLS too. See HTTP/2 and HTTP/3.

So the question is never whether to use HTTPS. It is how to keep its speed cost as small as possible. In Lighthouse 13.5 the audit Uses HTTPS is in the Best practices category with a weight of 5, among the heaviest there, and Redirects HTTP traffic to HTTPS has a weight of 1. A third check, Use a strong HSTS policy, is listed for information and does not count towards the score.

Where HTTPS adds time

Each new connection needs the secure handshake described in connection setup. With TLS 1.2 it takes two round trips. With TLS 1.3 it takes one, which web.dev puts at a third less connection setup time for HTTP/1 and HTTP/2. After the handshake, encrypting the traffic itself costs very little.

The extra time comes from these sources:

Step 1: use TLS 1.3 and modern protocols

Ask your host or CDN to confirm that TLS 1.3 is enabled. In the 2025 Web Almanac, 99% of the page requests answered by CDNs used TLS 1.3. For third-party requests the share was 96% on CDNs and 78% on servers outside a CDN, up from 68% a year earlier. The same lab tests found the median TLS negotiation for a page took 57 milliseconds on a CDN against 177 on an origin server on desktop, and 183 against 302 on mobile. These are controlled measurements and show direction, not a promise.

If you run the server yourself, use a configuration generator from a trusted source rather than writing cipher lists by hand. MDN recommends Mozilla's SSL Configuration Generator, which produces settings for common servers, based on Mozilla's TLS guidelines.

Step 2: redirect once, on the same host

Most sites keep listening on the insecure port so that an address typed without https:// still works. That is fine, with two rules from MDN:

  1. Redirect to the same address on HTTPS, and nowhere else.
  2. Do not redirect from HTTP on one host to HTTPS on a different host in one step. If the host must change, first go to HTTPS on the same host, then redirect on to the other. A jump straight across prevents HSTS from being set for the first host.

On Nginx this is:

server {
  listen 80;
  return 301 https://$host$request_uri;
}

On Apache, for one host:

<VirtualHost *:80>
  ServerName site.example.org
  Redirect permanent / https://site.example.org/
</VirtualHost>

Then remove the need for the redirect wherever you can. Every link on your site, every address in your sitemap, social profiles, ads and emails should use the final https address, with the host name you have chosen. See time to first byte for how redirects add to the wait.

Step 3: add HSTS, carefully

The Strict-Transport-Security header, HSTS, tells the browser to use HTTPS for your site even if someone types or follows an http address. The browser upgrades the request itself, without going to the server and being redirected. For returning visitors that removes the redirect round trip altogether.

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Be careful. Once a browser has seen the header, the site must keep supporting HTTPS until the time expires. web.dev warns that setting too aggressive a policy without enough testing can break your website. Lighthouse's own HSTS check recommends a rollout in stages, starting with a low max-age. Raise it step by step while you check every host and every page.

Step 4: no mixed content

A secure page that asks for a script over plain HTTP has the script blocked. An image over plain HTTP loads with a warning and a degraded page. MDN's advice is to check that every resource is requested over HTTPS before you deploy. If a site has many old insecure addresses in its content, the upgrade-insecure-requests directive of the Content Security Policy tells browsers to treat them as HTTPS. Searching your content for http:// addresses, in posts, theme settings and plugin options, finds most of the rest.

Step 5: bring the handshake closer

The handshake is a series of round trips, so its cost depends on the distance. A CDN ends the visitor's secure connection on a server nearby. See what a CDN does. On your own server, choose hosting in the region where most of your visitors are, as the hosting guide explains.

HTTP/3 helps further. It builds on TLS 1.3, so a new connection takes one round trip and a returning visitor can resume with none, according to web.dev.

Keep the certificate valid

A browser requires a valid certificate from the server before it will make a secure connection. An expired or mismatched certificate does not just slow the page: visitors see a full-screen warning and most leave. Renew automatically if your host or certificate provider allows it, and watch the expiry date if not. Uptime monitoring that checks the certificate is worth having. A certificate also has to cover every host name you use, including www and the bare domain.

How to measure it

curl -o /dev/null -s -w 'tcp %{time_connect}s  tls done %{time_appconnect}s\n' https://example.com/

The TLS handshake is the difference between the second and the first number. Run it several times and from more than one place.

Check your own page

Run the free audit and check that the page passes Uses HTTPS and Redirects HTTP traffic to HTTPS, and look at whether Document request latency reports a redirect. Then type your address with http:// and with and without www, and count how many redirects happen before the final page. The answer should be one at most.

Sources

Start here

Free website audit

Live Google data for any public page: mobile and desktop.

Mobile + desktop · Lighthouse lab test · Real-user Chrome data when Google has it

Rather have this done for you? Speed optimization · Book a call

Related guides

All guides →