DPR
**DPR**请求头是“ 客户端提示” (en-US)消息头,它代表客户端设备的像素比 (DPR),该比例是与每个 CSS 像素相对应的物理设备像素的数量。
| Header type | Request header |
|---|---|
| Forbidden header name | ? |
备注: 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.
语法
DPR: <number>
示例
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
浏览器兼容性
BCD tables only load in the browser