The HTTP headers Alt-Svc header is a response-type header it has been used to advertise alternative service. Which services can be defined by a protocol/host/port combination.
Alt-Svc: <protocol-id>=<alt-authority>; ma=<max-age>; persist=1
Directives: This header accept five directives as mentioned above and described below:
- clear: This directive define that all alternative services for that origin to be invalidated.
- <protocol-id>: This directive is the ALPN protocol identifier.
- <alt-authority>: This directive defines an alternative authority which consists of an optional host override, a colon, and a mandatory port number.
- ma=<max-age>: It holds the number that defines seconds for which the alternative service is considered fresh if it is omitted then the default value will be 86400. It is an optional directive.
- persist=1: This directive holds the alternative service which cleared on network configuration changes. Use of the persist=1 ensures that the entry is not deleted through such changes.
Alt-Svc: h2=":425"; ma=2585900; persist=1
Alt-Svc: h2=":485"; ma=592000;
To check this Alt-Svc in action go to Inspect Element -> Network check the request header for Alt-Svc like below, Alt-Svc is highlighted you can see.
Supported Browsers: The browsers compatible with HTTP headers Alt-Svc are listed below:
- Google Chrome
- Internet Explorer
- HTTP headers | Access-Control-Request-Headers
- HTTP headers | Access-Control-Expose-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | From
- HTTP headers | DNT
- HTTP headers
- HTTP headers | Tk
- HTTP headers | Via
- HTTP headers | Age
- HTTP Headers | TE
- HTTP headers | Allow
- HTTP headers | Expect-CT
- HTTP headers | Keep-Alive
- HTTP headers | SourceMap
- HTTP headers | expires
- HTTP headers | If-Unmodified-Since
- HTTP headers | Accept
- HTTP headers | If-None-Match
- HTTP headers | X-Forwarded-For
- HTTP headers | Trailer
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.