Device-Memory header
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
The HTTPDevice-Memoryrequest header is used indevice client hints to indicate the approximate amount of available RAM on the client device, in gigabytes.The header is part of theDevice Memory API.
Client hints are accessible only on secure origins.A server has to opt in to receive theDevice-Memory header from the client, by first sending theAccept-CH response header.Servers that opt in to theDevice-Memory client hint will typically also specify it in theVary 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 |
In this article
Syntax
Device-Memory: <number>Directives
<number>The approximate amount of device RAM. Possible values are:
0.25,0.5,1,2,4,8.The amount of device RAM can be used as afingerprinting variable, so values for the header are intentionally coarse to reduce the potential for its misuse.
Examples
The server first needs to opt in to receiveDevice-Memory header by sending theAccept-CH response header containingDevice-Memory:
Accept-CH: Device-MemoryThen on subsequent requests the client might sendDevice-Memory header back:
Device-Memory: 1Specifications
| Specification |
|---|
| Device Memory> # iana-device-memory> |