DPR - HTTP 编辑
Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。
DPR
请求头是“ 客户端提示”消息头,它代表客户端设备的像素比(DPR),该比例是与每个CSS像素相对应的物理设备像素的数量。
Header type | Request header |
---|---|
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 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
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论