Device-Memory
Adaptive content delivery requires knowing the client device's capabilities. 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 the closest value on a short ladder of powers of
two, ties resolving to the lower bound, clamped
at platform-specific floors and ceilings, to reduce
fingerprinting exposure. A desktop with 12 GB of physical
RAM reports 8 as the tie resolves down, while a 7 GB
machine reports 8 as the closest rung.
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.
The Device Memory API specification, which defines the
Sec-CH-Device-Memory hint name alongside the legacy
Device-Memory form, was published by the W3C as a
Discontinued Draft and is no longer maintained.
Chromium kept both headers and sends them when the
server opts in to both through Accept-CH, so the hint
keeps working in Chromium-based browsers while the
specification itself counts as abandoned work.
Values
Reported values depend on the browser and platform. The specification leaves the floor and ceiling of the ladder to the implementation and expects mobile devices to use different bounds from desktops. Chrome clamps values differently on desktop and Android, with the rungs below reflecting its current ladders.
1
The device has approximately 1 GB of RAM. The floor value on Android, covering low-end hardware where aggressive resource reduction applies.
2
The device has approximately 2 GB of RAM. Common on budget mobile devices, and the floor value on desktop.
4
The device has approximately 4 GB of RAM. Common on mid-range mobile devices.
8
The device has approximately 8 GB of RAM. The ceiling
value on Android, so higher-memory Android devices
report 8.
16
The device has approximately 16 GB of RAM. Common on desktop hardware.
32
The device has 32 GB or more of RAM. The ceiling value on desktop.
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 Android device reports 1 GB. The server responds with a lightweight version of the page, reducing image resolution and deferring non-essential scripts.
Device-Memory: 1
The server opt-in response looks like this.
Accept-CH: Device-Memory
See also
- Device Memory API (W3C Discontinued Draft)
- Accept-CH
- Save-Data
- Downlink
- ECT
- Client-Hints
- HTTP headers