Serve responsive images with srcset

srcset with width descriptors and a sizes attribute lets the browser choose an appropriate file per viewport and pixel density. Without sizes, phones download desktop-size images. Provide at least three widths, keep dimensions to reserve layout space, and check the chosen file in the Network panel.

mediumIn codeimpact effort

Why this matters

Give the browser several widths and let it pick per device.

Get the full breakdown

The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.

Join the waitlist

Before you start

  • A build step or CDN that can generate multiple widths

How to apply it

  1. Generate width variants General best practice

    Produce at least three widths per content image, such as 480, 960 and 1440 pixels, at the same aspect ratio. Do not upscale beyond the source.

    Check: For a sampled image, the CDN or build output lists three files with the expected widths.

  2. Add srcset and an honest sizes value

    Set srcset with width descriptors and sizes that match the CSS layout, for example (max-width: 640px) 100vw, 720px. Keep width and height attributes.

    Check: The rendered img element contains srcset, sizes, width and height.

  3. Confirm the selected file General best practice

    Load the page at a 390-pixel viewport with a simulated 3x DPR and check the Network panel for the image request actually used.

    Check: The selected file is the smallest candidate that covers the rendered width times DPR.

Get the prompt for your agent

A ready-to-paste prompt for your agent that implements this tip and verifies the result in your repo.

Join the waitlist

Source: seo-mcp playbook · curated entry · report an error

Framework notes

nextjs-app

`next/image` with `sizes` emits srcset automatically; set `sizes` to match the layout or it defaults to 100vw.

astro

`<Image />` from `astro:assets` generates srcset from `widths` and `sizes`; `<Picture>` emits format fallbacks.

Official references

Let your agent apply this + 161 more tips.

Pre-order — $19