Alt-Svc
ResponseActiveAlt-Svc (Alternative Services) advertises alternative endpoints for the current service – different protocols (h3, h2), ports, or hostnames. Browsers use it to upgrade from HTTP/2 to HTTP/3 (QUIC). The client caches Alt-Svc entries and uses them on subsequent requests. This is how sites announce HTTP/3 availability without DNS changes.
Alt-Svc: <protocol-id>="<host>:<port>"[; ma=<seconds>][; persist=1] | clear
Description
Alt-Svc allows a server to say 'I also speak this protocol at this endpoint'. The most common use is advertising HTTP/3: Alt-Svc: h3=":443"; ma=86400 tells the browser to try QUIC on port 443 for the next 86400 seconds. The ma (max-age) parameter controls how long the browser caches the alternative. clear invalidates all cached alternatives. Supported by Chrome, Firefox, and Safari for HTTP/3 negotiation.
Directives
| Directive | Description |
|---|---|
| h3 | HTTP/3 over QUIC. Most common usage. |
| h2 | HTTP/2 at an alternative endpoint. |
| ma | Max-age in seconds to cache this alternative. |
| persist | If 1, the alternative survives network changes. |
| clear | Invalidates all cached alternatives for this origin. |
Examples
Advertise HTTP/3
http
Alt-Svc: h3=":443"; ma=86400Multiple protocols
http
Alt-Svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400Clear alternatives
http
Alt-Svc: clear