Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. Headers
  5. Content-DPR

Content-DPR header

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see thecompatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

The HTTPContent-DPRresponse header is used to confirm theimage device to pixel ratio (DPR) in requests where the screenDPR client hint was used to select an image resource.

Note:TheContent-DPR header was removed from the client hints specification indraft-ietf-httpbis-client-hints-07.TheResponsive Image Client Hints specification proposes to replace this header by specifying intrinsic resolution/dimensions in EXIF metadata.

If theDPR client hint is used to select an image, the server must specifyContent-DPR in the response.If the value inContent-DPR is different from theDPR value in the request (i.e., image DPR is not the same as screen DPR), the client must use theContent-DPR for determining intrinsic image size and scaling the image.

If theContent-DPR header appears more than once in a message, the last occurrence is used.

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

Syntax

http
Content-DPR: <number>

Directives

<number>

The image device pixel ratio, calculated according to the following formula:Content-DPR =Selected image resource size / (Width /DPR)

Examples

See theDPR header example.

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp