Testing Responsive Images Across Viewports
You'll learn how to verify which image sources browsers actually load from your responsive image configurations using DevTools and network monitoring.
Why Testing Matters
After configuring srcset, sizes, and <picture> elements, you need to confirm browsers are selecting the right images. Just because you've written the markup doesn't mean it's working optimally—browsers make complex decisions based on viewport width, device pixel ratio, and network conditions.
Using Browser DevTools
Open Chrome DevTools (F12) and navigate to the Network tab. Filter by "Img" to see only images. Reload your page at different viewport widths by resizing the browser window or using Device Mode (Ctrl+Shift+M).
For each image request, inspect:
- Name column: Shows which specific file was downloaded
- Size: Displays the file's actual byte size
- Initiator: Confirms which
<img>or<source>triggered the request
Device Mode Testing
Chrome's Device Mode lets you emulate various devices with different:
- Viewport dimensions (e.g., 375px mobile, 768px tablet, 1920px desktop)
- Pixel densities (1x, 2x, 3x for Retina displays)
Switch between devices and hard-reload (Ctrl+Shift+R) to force the browser to re-evaluate srcset and sizes attributes. Watch the Network tab to see different image variants load.
Network Throttling Analysis
Test under simulated slow connections ("Fast 3G," "Slow 3G") to observe browser resource prioritization. Modern browsers may adapt image selection based on available bandwidth.
Practical Verification Steps
- Resize viewport to target breakpoint (e.g., 320px, 768px, 1200px)
- Hard-reload to clear cached decisions
- Check Network tab: Does the loaded image match your intended
sizescalculation? - Toggle pixel density: Does 2x device load the @2x variant?
Key Takeaway: Browser DevTools Network tab and Device Mode are essential for verifying that your responsive image configurations actually deliver the right images at each viewport size and pixel density.