Spec-Zone.ru › HTTP

Headers: Device-Memory

Device-Memory header

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

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

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Warning: The Device-Memory header was standardized as Sec-CH-Device-Memory and the new name is now preferred.

The HTTP Device-Memory request header is used in device client hints to indicate the approximate amount of available RAM on the client device, in gigabytes. The header is part of the Device Memory API.

Client hints are accessible only on secure origins. A server has to opt in to receive the Device-Memory header from the client, by first sending the Accept-CH response header. Servers that opt in to the Device-Memory client hint will typically also specify it in the Vary header to inform caches that the server may send different responses based on the header value in a request.

Header type Request header, Client hint
Forbidden request header No

Syntax

Device-Memory: <number>

Directives

<number>

The approximate amount of device RAM.

The amount of device RAM can be used as a fingerprinting variable, so values for the header are intentionally coarse to reduce the potential for its misuse. Values are only reported in powers of two, and are clamped to an implementation-defined minimum lower value and a maximum upper value. These bounds may change over time (see browser compatibility table).

For example, if a browser does not report below 2 or above 32 then the value is one of: 2, 4, 8, 16, 32.

Examples

The server first needs to opt in to receive Device-Memory header by sending the Accept-CH response header containing Device-Memory:

Accept-CH: Device-Memory

Then on subsequent requests the client might send Device-Memory header back:

Device-Memory: 1

Specifications

This feature does not appear to be defined in any specification.>

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
Device-Memory
61["From Chrome 147, reported values are 2, 4, 8, 16, and 32.", "Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8."]
79["From Edge 147, reported values are 2, 4, 8, 16, and 32.", "Before Edge 147, reported values were 0.25, 0.5, 1, 2, 4, and 8."]
No
48["From Opera 131, reported values are 2, 4, 8, 16, and 32.", "Before Opera 131, reported values were 0.25, 0.5, 1, 2, 4, and 8."]
No
61["From Chrome 147, reported values are 1, 2, 4, and 8.", "Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8."]
No
45["From Chrome 147, reported values are 1, 2, 4, and 8.", "Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8."]
No
8.0["From Chrome 147, reported values are 1, 2, 4, and 8.", "Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8."]
61["From Chrome 147, reported values are 1, 2, 4, and 8.", "Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8."]
No

See also

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

© 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/Device-Memory

Spec-Zone.ru

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