W3cubDocs

/HTTP

DPR

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The DPR header is a Client Hints headers which represents the client device pixel ratio (DPR), which is the the number of physical device pixels corresponding to every CSS pixel.

Note: Client Hints are accessible only on secure origins (via TLS). Server has to opt in to receive DPR header from the client by sending Accept-CH and Accept-CH-Lifetime response headers.

Syntax

DPR: <number>

Examples

Server first needs to opt in to receive DPR header by sending the response headers Accept-CH containing DPR and Accept-CH-Lifetime.

Accept-CH: DPR
Accept-CH-Lifetime: 86400

Then on subsequent requests the client might send DPR header back:

DPR: 1.0

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
DPR 46 ≤79 ? ? 33 ?
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
DPR 46 46 ? 33 ? 5.0

See also

© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DPR