Alt-Svc header

The HTTP Alt-Svc response header lets a server indicate that another network location (the "alternative service") can be treated as authoritative for that origin when making future requests.

Doing so allows new protocol versions to be advertised without affecting in-flight requests and can also help servers manage traffic. Using an alternative service is not visible to the end user; it does not change the URL or the origin of the request and does not introduce additional round trips.

Header type Response header

Syntax

http
Alt-Svc: clear
Alt-Svc: <protocol-id>=<alt-authority>; ma=<max-age>
Alt-Svc: <protocol-id>=<alt-authority>; ma=<max-age>; persist=1
clear

All alternative services of the origin are invalidated.

<protocol-id>

The Application-Layer Protocol Negotiation (ALPN) protocol identifier. Examples include h2 for HTTP/2 and h3-25 for draft 25 of the HTTP/3 protocol.

<alt-authority>

A quoted string specifying the alternative authority, consisting of an optional host override, a colon, and a mandatory port number.

ma=<max-age> Optional

The number of seconds for which the alternative service is considered fresh. If omitted, it defaults to 24 hours. Alternative service entries can be cached for up to <max-age> seconds, minus the age of the response (from the Age header). Once the cached entry expires, the client can no longer use this alternative service for new connections.

persist=1 Optional

Entries are not deleted by network configuration changes. Cached alternative service entries are usually cleared on such changes.

Multiple entries can be specified in a single Alt-Svc header using comma as separator. In that case, early entries are considered more preferable.

Example

http
Alt-Svc: h2=":443"; ma=2592000;
Alt-Svc: h2=":443"; ma=2592000; persist=1
Alt-Svc: h2="alt.example.com:443", h2=":443"
Alt-Svc: h3-25=":443"; ma=3600, h2=":443"; ma=3600

Specifications

Specification
HTTP Alternative Services
# alt-svc

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Alt-Svc
Chrome – Full support
Chrome 52 (Release date: 2016-07-20)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Partial support
Firefox 37 – 37 (Release date: 2015-03-31)
footnote Partial support
footnote Only supports draft-04
Firefox – Full support
Firefox 38 (Release date: 2015-05-12)
footnote Full support
Opera – Full support
Opera 39 (Release date: 2016-08-02)
footnote Full support
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote
footnote See bug 255017
Chrome Android – Full support
Chrome Android 52 (Release date: 2016-07-27)
footnote Full support
Firefox for Android – Partial support
Firefox for Android 37 – 37 (Release date: 2015-03-31)
footnote Partial support
footnote Only supports draft-04
Firefox for Android – Full support
Firefox for Android 38 (Release date: 2015-05-12)
footnote Full support
Opera Android – Full support
Opera Android 41 (Release date: 2016-10-25)
footnote Full support
Safari on iOS – Full support
Safari on iOS 17 (Release date: 2023-09-18)
footnote
footnote See bug 255017
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 52 (Release date: 2016-07-27)
footnote Full support
WebView on iOS – Full support
WebView on iOS 17 (Release date: 2023-09-18)
footnote
footnote See bug 255017

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
See implementation notes.
Has more compatibility info.

See also