The web HSTS 2 min read

What is HSTS?

Your browser opened a site securely yesterday. Today you follow an old HTTP link to the same host. Can the browser upgrade it before making the request?

  1. Learn the policy over HTTPS

    The site sends a Strict-Transport-Security response header over HTTPS. Its max-age tells the browser how long to remember that the host should be reached using HTTPS.

    HTTPS response → Remember HSTS → Upgrade next URL HTTPS responseRemember HSTSUpgrade next URL

    In short The browser learns HSTS from a secure connection.

  2. Upgrade the next visit before sending it

    While that policy is active, the browser rewrites an HTTP URL for that host to HTTPS before making a network request. The connection still has to pass normal HTTPS certificate checks.

    In short A remembered policy upgrades the URL before the network request.

Where this applies

A first visit can happen before the browser has learned the policy. Preloading can address that first-visit gap for eligible hosts.

Keep this

HSTS tells the browser to use HTTPS on future visits.

Distinguish a browser upgrade before the request from a server redirect after one.

Sources

Last reviewed 21 November 2026.

Next byte · The web HTTP vs HTTPS