Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. Headers
  5. Save-Data

Save-Data header

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

The HTTPSave-Datarequest header is anetwork client hint which indicates the client's preference for reduced data usage.This could be for reasons such as high transfer costs, slow connection speeds, etc.

Save-Data is alow entropy hint, and hence may be sent by the client even if not requested by the server using anAccept-CH response header.Further, it should be used to reduce data sent to the client irrespective of the values of other client hints that indicate network capability, likeDownlink andRTT.

A value ofOn indicates explicit user opt-in into a reduced data usage mode on the client.When communicated to origins, this 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) may reduce data downloads.Note that this feature is no longer supported by default in most major browser engines.

Header typeRequest header,Client hint
Forbidden request headerNo
CORS-safelisted response headerNo

Syntax

http
Save-Data: <sd-token>

Directives

<sd-token>

A value indicating whether the client wants to opt in to reduced data usage mode.on indicates yes, whileoff (the default) indicates no.

Examples

UsingSave-Data: on

The following message requests a resource withSave-Data header indicating the client is opting in to reduced data mode:

http
GET /image.jpg HTTP/1.1Host: example.comSave-Data: on

The server responds with a200 response, and theVary header indicates thatSave-Data may have been used to create the response, and caches should be aware of this header to differentiate responses:

http
HTTP/1.1 200 OKContent-Length: 102832Vary: Accept-Encoding, Save-DataCache-Control: public, max-age=31536000Content-Type: image/jpeg[…]

OmittingSave-Data

In this case, the client requests the same resource without theSave-Data header:

http
GET /image.jpg HTTP/1.1Host: example.com

The server's response provides the full version of the content.TheVary header ensures that responses should be separately cached based on the value of theSave-Data header.This can ensure that the user is not served a lower-quality image from the cache when theSave-Data header is no longer present (e.g., after having switched from cellular to Wi-Fi).

http
HTTP/1.1 200 OKContent-Length: 481770Vary: Accept-Encoding, Save-DataCache-Control: public, max-age=31536000Content-Type: image/jpeg[…]

Specifications

Specification
Save Data API
# save-data-request-header-field

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp