Save-Data - HTTP | MDN

archived 11 Jun 2019 10:55:49 UTC
MDN Web Docs

Save-Data

The Save-Data header field is a boolean which, in requests, indicates the client's preference for reduced data usage. This could be for reasons such as high transfer costs, slow connection speeds, etc.
A value of On indicates explicit user opt-in into a reduced data usage mode on the client, and when communicated to origins allows them to deliver alternative content to reduce the data downloaded such as smaller image and video resources, different markup and styling, disabled polling and automatic updates, and so on.
Note: Disabling HTTP/2 Server Push (RFC 7540, section 8.2: Server Push) might be desirable too for reducing data downloads.

Syntax

Save-Data: <sd-token>

Directives

<sd-token>
A numerical value indicating whether the client wants to opt in to reduced data usage mode. on indicates yes, while off (the default) indicates no.

Examples

The Vary header ensures that the content is cached properly (for instance ensuring that the user is not served a lower-quality image from the cache when Save-Data header is no longer present [e.g. after having switched from cellular to Wi-Fi]).

With Save-Data: on

Request:
GET /image.jpg HTTP/1.0
Host: example.com
Save-Data: on
Response:
HTTP/1.0 200 OK
Content-Length: 102832
Vary: Accept-Encoding, Save-Data
Cache-Control: public, max-age=31536000
Content-Type: image/jpeg

[...]

Without Save-Data

Request:
GET /image.jpg HTTP/1.0
Host: example.com
Response:
HTTP/1.0 200 OK
Content-Length: 481770
Vary: Accept-Encoding, Save-Data
Cache-Control: public, max-age=31536000
Content-Type: image/jpeg

[...]

Specifications

Specification Title
draft-grigorik-http-client-hints-03, section 7: Save-Data HTTP Client Hints

Browser compatibility

The compatibility table in 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.
Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Save-Data
Experimental
Chrome Full support 49Edge ? Firefox ? IE ? Opera Full support 35Safari ? WebView Android Full support 49Chrome Android Full support 49Edge Mobile ? Firefox Android ? Opera Android Full support 35Safari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also

Document Tags and Contributors

Contributors to this page: boramalper, chrisdavidmills, SphinxKnight
Last updated by: boramalper,
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-Charset
    3. Accept-Encoding
    4. Accept-Language
    5. Accept-Patch
    6. Accept-Ranges
    7. Access-Control-Allow-Credentials
    8. Access-Control-Allow-Headers
    9. Access-Control-Allow-Methods
    10. Access-Control-Allow-Origin
    11. Access-Control-Expose-Headers
    12. Access-Control-Max-Age
    13. Access-Control-Request-Headers
    14. Access-Control-Request-Method
    15. Age
    16. Allow
    17. Alt-Svc
    18. Authorization
    19. Cache-Control
    20. Clear-Site-Data
    21. Connection
    22. Content-Disposition
    23. Content-Encoding
    24. Content-Language
    25. Content-Length
    26. Content-Location
    27. Content-Range
    28. Content-Security-Policy
    29. Content-Security-Policy-Report-Only
    30. Content-Type
    31. Cookie
    32. Cookie2
    33. Cross-Origin-Resource-Policy
    34. DNT
    35. Date
    36. ETag
    37. Early-Data
    38. Expect
    39. Expect-CT
    40. Expires
    41. Feature-Policy
    42. Forwarded
    43. From
    44. Host
    45. If-Match
    46. If-Modified-Since
    47. If-None-Match
    48. If-Range
    49. If-Unmodified-Since
    50. Index
    51. Keep-Alive
    52. Large-Allocation
    53. Last-Modified
    54. Link
    55. Location
    56. Origin
    57. Pragma
    58. Proxy-Authenticate
    59. Proxy-Authorization
    60. Public-Key-Pins
    61. Public-Key-Pins-Report-Only
    62. Range
    63. Referer
    64. Referrer-Policy
    65. Retry-After
    66. Save-Data
    67. Sec-WebSocket-Accept
    68. Server
    69. Server-Timing
    70. Set-Cookie
    71. Set-Cookie2
    72. SourceMap
    73. Strict-Transport-Security
    74. TE
    75. Timing-Allow-Origin
    76. Tk
    77. Trailer
    78. Transfer-Encoding
    79. Upgrade-Insecure-Requests
    80. User-Agent
    81. Vary
    82. Via
    83. WWW-Authenticate
    84. Warning
    85. X-Content-Type-Options
    86. X-DNS-Prefetch-Control
    87. X-Forwarded-For
    88. X-Forwarded-Host
    89. X-Forwarded-Proto
    90. X-Frame-Options
    91. 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. 403 Forbidden
    21. 404 Not Found
    22. 405 Method Not Allowed
    23. 406 Not Acceptable
    24. 407 Proxy Authentication Required
    25. 408 Request Timeout
    26. 409 Conflict
    27. 410 Gone
    28. 411 Length Required
    29. 412 Precondition Failed
    30. 413 Payload Too Large
    31. 414 URI Too Long
    32. 415 Unsupported Media Type
    33. 416 Range Not Satisfiable
    34. 417 Expectation Failed
    35. 418 I'm a teapot
    36. 422 Unprocessable Entity
    37. 425 Too Early
    38. 426 Upgrade Required
    39. 428 Precondition Required
    40. 429 Too Many Requests
    41. 431 Request Header Fields Too Large
    42. 451 Unavailable For Legal Reasons
    43. 500 Internal Server Error
    44. 501 Not Implemented
    45. 502 Bad Gateway
    46. 503 Service Unavailable
    47. 504 Gateway Timeout
    48. 505 HTTP Version Not Supported
    49. 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: object-src
    14. CSP: plugin-types
    15. CSP: referrer
    16. CSP: report-uri
    17. CSP: require-sri-for
    18. CSP: sandbox
    19. CSP: script-src
    20. CSP: style-src
    21. CSP: upgrade-insecure-requests
    22. CSP: worker-src
    23. report-to
  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: autoplay
    2. Feature-Policy: camera
    3. Feature-Policy: display-capture
    4. Feature-Policy: encrypted-media
    5. Feature-Policy: fullscreen
    6. Feature-Policy: geolocation
    7. Feature-Policy: microphone
    8. Feature-Policy: midi
    9. Feature-Policy: payment
    10. Feature-Policy: vr
    11. document-domain

Thanks! Please check your inbox to confirm your subscription.

If you haven’t previously confirmed a subscription to a Mozilla-related newsletter you may have to do so. Please check your inbox or your spam filter for an email from us.
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%