Device Memory API
Detect how much RAM a device has with the Device Memory API — available for all websites and PWAs.
Overview
The Device Memory API allows websites and PWAs to estimate the amount of RAM on a user's device. It can be used to identify lower-end devices and deliver a lighter, performance-optimized version of the site. The value returned by this API does not indicate how much memory is actually available — it simply provides a rough classification of the device's memory capacity.
How to use it
The API has two parts. The first is a JavaScript property that exposes the estimated memory size. The second is a Client Hint mechanism: when a server opts in by including the Accept-CH: Device-Memory HTTP response header, the browser sends the total device memory information in the Device-Memory request header. This allows the server to deliver content optimized for that particular class of device.
Demo
Your device memory is API
Code
Ready to generate your PWA?
Try our PWA toolkit free of charge and without limits for 14 days. No credit card required.
Generate PWA See plans