The Resolution Switching Problem
You'll learn why sending the same image file to every device wastes bandwidth and how modern HTML helps solve this.
Imagine mailing everyone the same extra-large poster, whether they live in a mansion or a tiny apartment. That's what happens when your website sends a massive 2400×1600 image to every device—from desktop monitors to smartphones.
Why This Is a Problem
When you use a simple <img src="photo.jpg">, every visitor downloads the exact same image file. A phone with a 375px-wide screen downloads the same multi-megabyte file as a 4K desktop monitor. The phone then shrinks that huge image down to fit its tiny screen, wasting:
- Bandwidth: Users pay for data they don't need
- Load time: Slower networks wait longer
- Battery: Processing large images drains power
- Memory: Devices struggle with oversized files
A 2MB desktop image might only need to be 200KB on mobile—that's 90% waste.
The Traditional (Broken) Approach
For years, developers had no choice. You picked one image size and served it universally. Too small looked blurry on large screens. Too large punished mobile users.
The Solution Preview
HTML now provides srcset, an attribute that lets you offer multiple versions of the same image. The browser chooses the best fit based on screen size and resolution. It's like having a smart delivery system that sends the mansion-sized poster to mansions and the apartment-sized print to apartments.
This is called resolution switching—serving appropriately sized images based on the viewing context.
Key Takeaway: The resolution switching problem means serving one-size-fits-all images wastes bandwidth on smaller devices; srcset solves this by letting browsers pick the right image size automatically.