Device-Memory
The HTTP Device-Memory request header is a client hint reporting the approximate amount of RAM on the device in gigabytes.
Usage
The Device-Memory header is part of the Device Memory
API. Servers opt in to receive this header by sending the
Accept-CH response header with
Device-Memory listed as an accepted hint. The browser then
includes the header in subsequent requests over a secure
(HTTPS) connection.
Servers use the reported memory to tailor responses. A device with limited RAM benefits from lighter page weights, fewer JavaScript bundles, and smaller image assets. A device with ample memory receives richer experiences without performance concerns.
The value is not the exact installed RAM. Browsers round the
figure to a set of predefined values to reduce
fingerprinting exposure: 0.25, 0.5, 1, 2, 4, and
8. A device with 12 GB of physical RAM reports 8 because
the browser rounds to the nearest value in the predefined
set.
Combining Device-Memory with Save-Data and network hints like Downlink and ECT gives servers a fuller picture of the client environment for adaptive content delivery.
Values
0.25
The device has approximately 256 MB of RAM. Low-end hardware where aggressive resource reduction applies.
0.5
The device has approximately 512 MB of RAM.
1
The device has approximately 1 GB of RAM.
2
The device has approximately 2 GB of RAM. Common on mid-range mobile devices.
4
The device has approximately 4 GB of RAM. Common on desktop and higher-end mobile devices.
8
The device has 8 GB or more of RAM.
Example
A mobile device with 2 GB of RAM sends the following request header after the server opts in through Accept-CH.
Device-Memory: 2
A low-memory device reports 0.25 GB. The server responds with a lightweight version of the page, reducing image resolution and deferring non-essential scripts.
Device-Memory: 0.25
The server opt-in response looks like this.
Accept-CH: Device-Memory
Takeaway
The Device-Memory header provides servers with an approximate RAM figure so they adapt content weight and complexity to match the capabilities of the client device.