DPR

This translation is incomplete. Please help translate this article from English

{{HTTPSidebar}}{{securecontext_header}}{{SeeCompatTable}}

 DPR请求头是“ 客户端提示”消息头,它代表客户端设备的像素比({{Glossary(“ DPR”)}}},该比例是与每个CSS像素相对应的物理设备像素的数量。

Header type {{Glossary("Request header")}}
{{Glossary("Forbidden header name")}} ?

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 {{HTTPHeader("Accept-CH")}} and {{HTTPHeader("Accept-CH-Lifetime")}} response headers.

Syntax

DPR: <number>

Examples

Server first needs to opt in to receive DPR header by sending the response headers {{HTTPHeader("Accept-CH")}} containing DPR and {{HTTPHeader("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 compatibility

{{Compat("http.headers.DPR")}}

See also

  • {{HTTPHeader("Accept-CH")}}
  • {{HTTPHeader("Accept-CH-Lifetime")}}
  • {{HTTPHeader("Vary")}}