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.
In this article
Syntax
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
- Device and responsive image client hints
Accept-CH- HTTP Caching: Vary and
Vary - Improving user privacy and developer experience with User-Agent Client Hints on developer.chrome.com (2020)