Testing Responsive Image Delivery
You'll learn how to verify that browsers actually download the correct image variant at different screen sizes.
Why Testing Matters
You've set up srcset, sizes, and maybe even the picture element—but how do you know it's working? Browsers make smart decisions about which image to download based on viewport size and pixel density, but you need to verify those decisions are happening as expected.
The Network Panel is Your Window
Open your browser's DevTools (F12 or right-click → Inspect) and navigate to the Network tab. This panel shows every resource your page requests, including images.
Here's how to test:
- Clear the cache (important!) using the clear button in the Network panel
- Filter by "Img" to see only image requests
- Refresh the page and watch which image files load
- Note the file name and size—does it match your small, medium, or large variant?
- Resize your browser viewport (make it narrower or wider)
- Hard refresh (Ctrl+Shift+R or Cmd+Shift+R) to force new image selection
- Check if a different image variant loads
What You're Looking For
At a narrow viewport (mobile), you should see image-small.jpg (maybe 50KB). At a wide viewport (desktop), you should see image-large.jpg (maybe 200KB). If both viewports download the same huge image, your responsive images aren't working.
Remember: browsers won't switch images on resize without a refresh—they're efficient and keep what they already downloaded.
Key Takeaway: Use the DevTools Network panel to confirm browsers download the appropriate image variants at different viewport sizes, validating your srcset and sizes implementation.