--- title: DPR slug: Web/HTTP/Headers/DPR translation_of: Web/HTTP/Headers/DPR ---
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.
DPR: <number>
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
{{Compat("http.headers.DPR")}}