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

http
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:

http
Accept-CH: Device-Memory

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

http
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 request header
Deprecated Non-standard
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote
footnote From Chrome 147, reported values are 2, 4, 8, 16, and 32.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote
footnote From Edge 147, reported values are 2, 4, 8, 16, and 32.
footnote Before Edge 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote
footnote From Opera 131, reported values are 2, 4, 8, 16, and 32.
footnote Before Opera 131, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView Android – Full support
WebView Android 61 (Release date: 2017-09-05)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.
See implementation notes.

See also