Spec-Zone.ru › HTTP

Headers: Sec-CH-Width

Sec-CH-Width header

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The HTTP Sec-CH-Width request header is a device client hint which indicates the desired resource width in physical pixels — the intrinsic size of an image. The provided pixel value is a number rounded to the smallest following integer (i.e., ceiling value).

The hint is only sent on image requests.

The hint allows the client to request a resource that is optimal for both the screen and the layout: taking into account both the density-corrected width of the screen and the image's extrinsic size within the layout.

If the desired resource width is not known at the time of the request or the resource does not have a display width, the Sec-CH-Width header field can be omitted. If the Sec-CH-Width header appears more than once in a message the last occurrence is used.

Header type Request header, Client hint
Forbidden request header No

Syntax

Width: <number>

Directives

<number>

The width of the resource in physical pixels, rounded up to the nearest integer.

Examples

The server first needs to opt in to receive the Sec-CH-Width header by sending the response headers Accept-CH containing Sec-CH-Width.

Accept-CH: Sec-CH-Width

Then on subsequent image requests the client might send Sec-CH-Width header back:

Width: 1920

Specifications

Specification
Responsive Image Client Hints>
# sec-ch-width>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
Sec-CH-Width 9746 9779 No 8333 No 9746 No 6833 No 18.05.0 9746 No

See also

  • Device and responsive image client hints
    • Width
    • Sec-CH-Viewport-Width
    • Sec-CH-Viewport-Height
    • Sec-CH-Device-Memory
    • Sec-CH-DPR
  • Accept-CH
  • HTTP Caching: Vary and Vary header
  • Improving user privacy and developer experience with User-Agent Client Hints (developer.chrome.com)

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-Width

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API