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-Expose-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | Access-Control-Request-Headers
- HTTP headers | Location
- HTTP headers | User-Agent
- HTTP headers | Link
- HTTP headers | Save-Data
- HTTP headers | Content-Type
- HTTP headers | X-Forwarded-Proto
- HTTP headers | X-XSS-Protection
- HTTP headers | X-Frame-Options
- HTTP headers | Last-Modified
- HTTP headers | Date
- HTTP headers | Cookie
- HTTP headers | Strict-Transport-Security
- HTTP headers | Expect
- HTTP headers | Accept-Encoding
- HTTP headers | Proxy-Authenticate
- HTTP headers | Content-Range
- HTTP headers | Content-Encoding
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.