Skip to main content

Alt-Svc

ResponseActive

Alt-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

DirectiveDescription
h3HTTP/3 over QUIC. Most common usage.
h2HTTP/2 at an alternative endpoint.
maMax-age in seconds to cache this alternative.
persistIf 1, the alternative survives network changes.
clearInvalidates all cached alternatives for this origin.

Examples

Advertise HTTP/3
http
Alt-Svc: h3=":443"; ma=86400
Multiple protocols
http
Alt-Svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
Clear alternatives
http
Alt-Svc: clear

Specification

RFC 7838Alt-Svc specification →