Alt-Svc - HTTP - UDN Web Docs

  • Syntax
  • Example
  • Specifications
  • Browser compatibility
  • See also
  • Related topics

The Alt-Svc HTTP response header is used to advertise alternative services through which the same resource can be reached. An alternative service is defined by a protocol/host/port combination.

Syntax

Alt-Svc: clear Alt-Svc: <protocol-id>=<alt-authority>; ma=<max-age> Alt-Svc: <protocol-id>=<alt-authority>; ma=<max-age>; persist=1 clear The special value ''clear" indicates that the origin requests all alternatives for that origin to be invalidated. <protocol-id> The ALPN protocol identifier. Examples include h2 for HTTP/2 and h3-25 for draft 25 of the HTTP/3 protocol. <alt-authority> The quoted string specifying the alternative authority which consists 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). If the cached entry expires, the client can no longer use this alternative service for new connections. persist=1Optional Usually cached alternative service entries are cleared on network configuration changes. Use of the persist=1 parameter ensures that the entry is not deleted through 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

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 Status Comment
RFC 7838 IETF RFC Initial definition.

Browser compatibility

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Alt-SvcChrome Full support YesEdge Full support ≤79Firefox Full support 38 Full support 38 No support 37 — 38Notes Notes Only supports draft-04 No support 35 — 37Notes Disabled Notes Only supports draft-03Disabled From version 35 until version 37 (exclusive): this feature is behind the network.http.altsvc.enabled preference (needs to be set to true) and the altsvc.oe preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 38 Full support 38 No support 37 — 38Notes Notes Only supports draft-04 No support 35 — 37Notes Disabled Notes Only supports draft-03Disabled From version 35 until version 37 (exclusive): this feature is behind the network.http.altsvc.enabled preference (needs to be set to true) and the altsvc.oe preference (needs to be set to true). To change preferences in Firefox, visit about:config.Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support Full support Compatibility unknown Compatibility unknownSee implementation notes.See implementation notes.User must explicitly enable this feature.User must explicitly enable this feature.

See also

  • Identifying resources on the Web
Related Topics
  1. HTTP
  2. Guides:
  3. Resources and URIs
    1. Identifying resources on the Web
    2. Data URIs
    3. Introduction to MIME Types
    4. Complete list of MIME Types
    5. Choosing between www and non-www URLs
  4. HTTP guide
    1. Basics of HTTP
    2. Overview of HTTP
    3. Evolution of HTTP
    4. HTTP Messages
    5. A typical HTTP session
    6. Connection management in HTTP/1.x
    7. Protocol upgrade mechanism
  5. HTTP security
    1. Content Security Policy (CSP)
    2. HTTP Public Key Pinning (HPKP)
    3. HTTP Strict Transport Security (HSTS)
    4. Cookie security
    5. X-Content-Type-Options
    6. X-Frame-Options
    7. X-XSS-Protection
    8. Mozilla web security guidelines
    9. Mozilla Observatory
  6. HTTP access control (CORS)
  7. HTTP authentication
  8. HTTP caching
  9. HTTP compression
  10. HTTP conditional requests
  11. HTTP content negotiation
  12. HTTP cookies
  13. HTTP range requests
  14. HTTP redirects
  15. HTTP specifications
  16. Feature policy
  17. References:
  18. HTTP headers
    1. Accept
    2. Accept-CH
    3. Accept-CH-Lifetime
    4. Accept-Charset
    5. Accept-Encoding
    6. Accept-Language
    7. Accept-Patch
    8. Accept-Ranges
    9. Access-Control-Allow-Credentials
    10. Access-Control-Allow-Headers
    11. Access-Control-Allow-Methods
    12. Access-Control-Allow-Origin
    13. Access-Control-Expose-Headers
    14. Access-Control-Max-Age
    15. Access-Control-Request-Headers
    16. Access-Control-Request-Method
    17. Age
    18. Allow
    19. Alt-Svc
    20. Authorization
    21. Cache-Control
    22. Clear-Site-Data
    23. Connection
    24. Content-Disposition
    25. Content-Encoding
    26. Content-Language
    27. Content-Length
    28. Content-Location
    29. Content-Range
    30. Content-Security-Policy
    31. Content-Security-Policy-Report-Only
    32. Content-Type
    33. Cookie
    34. Cookie2
    35. Cross-Origin-Embedder-Policy
    36. Cross-Origin-Opener-Policy
    37. Cross-Origin-Resource-Policy
    38. DNT
    39. DPR
    40. Date
    41. Device-Memory
    42. Digest
    43. ETag
    44. Early-Data
    45. Expect
    46. Expect-CT
    47. Expires
    48. Feature-Policy
    49. Forwarded
    50. From
    51. Host
    52. If-Match
    53. If-Modified-Since
    54. If-None-Match
    55. If-Range
    56. If-Unmodified-Since
    57. Index
    58. Keep-Alive
    59. Large-Allocation
    60. Last-Modified
    61. Link
    62. Location
    63. NEL
    64. Origin
    65. Pragma
    66. Proxy-Authenticate
    67. Proxy-Authorization
    68. Public-Key-Pins
    69. Public-Key-Pins-Report-Only
    70. Range
    71. Referer
    72. Referrer-Policy
    73. Retry-After
    74. Save-Data
    75. Sec-Fetch-Dest
    76. Sec-Fetch-Mode
    77. Sec-Fetch-Site
    78. Sec-Fetch-User
    79. Sec-WebSocket-Accept
    80. Server
    81. Server-Timing
    82. Set-Cookie
    83. Set-Cookie2
    84. SourceMap
    85. Strict-Transport-Security
    86. TE
    87. Timing-Allow-Origin
    88. Tk
    89. Trailer
    90. Transfer-Encoding
    91. Upgrade-Insecure-Requests
    92. User-Agent
    93. Vary
    94. Via
    95. WWW-Authenticate
    96. Want-Digest
    97. Warning
    98. X-Content-Type-Options
    99. X-DNS-Prefetch-Control
    100. X-Forwarded-For
    101. X-Forwarded-Host
    102. X-Forwarded-Proto
    103. X-Frame-Options
    104. X-XSS-Protection
  19. HTTP request methods
    1. CONNECT
    2. DELETE
    3. GET
    4. HEAD
    5. OPTIONS
    6. PATCH
    7. POST
    8. PUT
    9. TRACE
  20. HTTP response status codes
    1. 100 Continue
    2. 101 Switching Protocols
    3. 103 Early Hints
    4. 200 OK
    5. 201 Created
    6. 202 Accepted
    7. 203 Non-Authoritative Information
    8. 204 No Content
    9. 205 Reset Content
    10. 206 Partial Content
    11. 300 Multiple Choices
    12. 301 Moved Permanently
    13. 302 Found
    14. 303 See Other
    15. 304 Not Modified
    16. 307 Temporary Redirect
    17. 308 Permanent Redirect
    18. 400 Bad Request
    19. 401 Unauthorized
    20. 402 Payment Required
    21. 403 Forbidden
    22. 404 Not Found
    23. 405 Method Not Allowed
    24. 406 Not Acceptable
    25. 407 Proxy Authentication Required
    26. 408 Request Timeout
    27. 409 Conflict
    28. 410 Gone
    29. 411 Length Required
    30. 412 Precondition Failed
    31. 413 Payload Too Large
    32. 414 URI Too Long
    33. 415 Unsupported Media Type
    34. 416 Range Not Satisfiable
    35. 417 Expectation Failed
    36. 418 I'm a teapot
    37. 422 Unprocessable Entity
    38. 425 Too Early
    39. 426 Upgrade Required
    40. 428 Precondition Required
    41. 429 Too Many Requests
    42. 431 Request Header Fields Too Large
    43. 451 Unavailable For Legal Reasons
    44. 500 Internal Server Error
    45. 501 Not Implemented
    46. 502 Bad Gateway
    47. 503 Service Unavailable
    48. 504 Gateway Timeout
    49. 505 HTTP Version Not Supported
    50. 506 Variant Also Negotiates
    51. 507 Insufficient Storage
    52. 508 Loop Detected
    53. 510 Not Extended
    54. 511 Network Authentication Required
  21. CSP directives
    1. CSP: base-uri
    2. CSP: block-all-mixed-content
    3. CSP: child-src
    4. CSP: connect-src
    5. CSP: default-src
    6. CSP: font-src
    7. CSP: form-action
    8. CSP: frame-ancestors
    9. CSP: frame-src
    10. CSP: img-src
    11. CSP: manifest-src
    12. CSP: media-src
    13. CSP: navigate-to
    14. CSP: object-src
    15. CSP: plugin-types
    16. CSP: prefetch-src
    17. CSP: referrer
    18. CSP: report-to
    19. CSP: report-uri
    20. CSP: require-sri-for
    21. CSP: sandbox
    22. CSP: script-src
    23. CSP: script-src-attr
    24. CSP: script-src-elem
    25. CSP: style-src
    26. CSP: style-src-attr
    27. CSP: style-src-elem
    28. CSP: trusted-types
    29. CSP: upgrade-insecure-requests
    30. CSP: worker-src
  22. CORS errors
    1. Reason: CORS disabled
    2. Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz'
    3. Reason: CORS header 'Access-Control-Allow-Origin' missing
    4. Reason: CORS header ‘Origin’ cannot be added
    5. Reason: CORS preflight channel did not succeed
    6. Reason: CORS request did not succeed
    7. Reason: CORS request external redirect not allowed
    8. Reason: CORS request not HTTP
    9. Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’
    10. Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’
    11. Reason: Multiple CORS header 'Access-Control-Allow-Origin' not allowed
    12. Reason: expected ‘true’ in CORS header ‘Access-Control-Allow-Credentials’
    13. Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’
    14. Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Methods’
    15. Reason: missing token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel
  23. Feature-Policy directives
    1. Feature-Policy: accelerometer
    2. Feature-Policy: ambient-light-sensor
    3. Feature-Policy: autoplay
    4. Feature-Policy: battery
    5. Feature-Policy: camera
    6. Feature-Policy: display-capture
    7. Feature-Policy: document-domain
    8. Feature-Policy: encrypted-media
    9. Feature-Policy: fullscreen
    10. Feature-Policy: geolocation
    11. Feature-Policy: gyroscope
    12. Feature-Policy: layout-animations
    13. Feature-Policy: legacy-image-formats
    14. Feature-Policy: magnetometer
    15. Feature-Policy: microphone
    16. Feature-Policy: midi
    17. Feature-Policy: oversized-images
    18. Feature-Policy: payment
    19. Feature-Policy: picture-in-picture
    20. Feature-Policy: publickey-credentials-get
    21. Feature-Policy: screen-wake-lock
    22. Feature-Policy: sync-xhr
    23. Feature-Policy: unoptimized-images
    24. Feature-Policy: unsized-media
    25. Feature-Policy: usb
    26. Feature-Policy: vibrate
    27. Feature-Policy: wake-lock
    28. Feature-Policy: xr
    29. Feature-Policy: xr-spatial-tracking

Từ khóa » Http 3 Alt-svc