Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/http/headers/content-dpr/index.md
6540 views
---
title: Content-DPR slug: Web/HTTP/Headers/Content-DPR status: - deprecated - non-standard browser-compat: http.headers.Content-DPR
---

{{HTTPSidebar}}{{deprecated_header}}{{securecontext_header}}{{Non-standard_header}}

The Content-DPR response header is used to confirm the image device to pixel ratio in requests where the screen {{HTTPHeader("DPR")}} client hint was used to select an image resource.

Header type {{Glossary("Response header")}}, Client hint
{{Glossary("Forbidden header name")}} no
{{Glossary("CORS-safelisted response header")}} no

If the {{HTTPHeader("DPR")}} client hint is used to select an image the server must specify Content-DPR in the response. If the value in Content-DPR is different from the {{HTTPHeader("DPR")}} value in the request (i.e. image DPR is not the same as screen DPR) then the client must use the Content-DPR for determining intrinsic image size and scaling the image.

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

Note:

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 the DPR header example.

Browser compatibility

{{Compat}}

See also