The code
Values: no-preference and reduce.
JavaScript: swap resources
// respect the user's data-saver preference
const reduceData = window.matchMedia('(prefers-reduced-data: reduce)');
function chooseHero() {
// only the chosen file is ever requested
heroImg.src = reduceData.matches ? 'hero-lite.jpg' : 'hero-heavy.jpg';
}
reduceData.addEventListener('change', chooseHero);
chooseHero();
Swap resources in JavaScript so only the chosen file is ever requested.
CSS: hide heavy decorations
@media (prefers-reduced-data: reduce) {
.hero-video { display: none; } /* poster image shows instead */
.decorative-bg { background-image: none; }
}
The CSS-only version, for hiding heavy decorations.
Why it matters
Data is a resource users pay for by the megabyte, and data-saver mode is them asking sites to spend less of it.
Metered, prepaid, roaming
Not everyone browses on unlimited fiber. Data plans are metered, prepaid, or roaming in much of the world, and even wealthy markets have dead zones, throttled connections, and airplane Wi-Fi. When a user turns on data-saver mode, they are asking every site to spend less of a resource they pay for by the megabyte.
The ask, mostly ignored
Most sites ignore the ask and ship the same multi-megabyte page to everyone. prefers-reduced-data lets the browser pass the request along, so you can serve a lighter hero, skip the autoplay video, and drop the decorative downloads for the people who asked.
Save-Data request header, which works today.Try it
One hero image, two weights. Only the chosen file is ever requested. Flip the override and open your Network tab to confirm the other never loads.
Same scene, two files: a 592 KB hero and a 19 KB hero. On the reduce path the page requests the 19 KB file and nothing else changes. The image is slightly softer. The user's data bill is roughly 97% smaller.
What else to gate
The hero image is the visible example. On the reduce path, the full checklist is:
Hero and inline images
Serve a lite variant or a smaller responsive size, like this demo.
Autoplay video
Show the poster frame; play only on tap.
Web fonts
Fall back to the system stack instead of downloading hundreds of KB.
Heavy animation libraries
Skip them and keep the page static.
Prefetch and preload
Drop prefetch and preload of below-the-fold resources. Speculative downloads are still downloads.
Server-side
Check the Save-Data request header for the same signal and trim the response before it leaves the server.
Best practices
The reduce path carries the same content at a lower weight.
Swap, don't stack
Decide which file to load before requesting anything. Loading the lite version and then upgrading to heavy spends the data twice.
Keep content identical
Every word, link, and feature survives the reduce path. Only weight changes.
Measure the saving
Report the KB difference in your own testing, the way this page does. If the saving is trivial, the gate is decoration.
Listen for changes
Data-saver can toggle mid-session as someone leaves Wi-Fi. The change event on the media query list is there for a reason.
Use the header too
The Save-Data request header reaches browsers the media query does not. Server and client together cover more users than either alone.
Browser support
Limited, as of October 2026.
Chrome
Exposes the query behind the experimental-web-platform-features flag.
Edge
Exposes the query behind the experimental-web-platform-features flag.
Firefox
Does not report it.
Safari
Does not report it.
Limited, as of October 2026. Chromium exposes the query behind a flag; Firefox and Safari do not implement it. The Save-Data header has wider reach in Chromium browsers. Treat the media query as progressive enhancement: harmless where unsupported, valuable where it lands.