Vitals 101
Vitals 101
@CoreVitals101

Serve Right-Sized Images With srcset

Serve Right-Sized Images With srcset

Sending a 2000-pixel-wide image to a phone that only shows 400 pixels wastes load time and hurts LCP — Largest Contentful Paint. The srcset attribute lets the browser pick the best-fitting size. Think of it like offering shirts in small, medium, and large instead of one giant size for everyone.

The playbook:
—
1. Create two or three sizes of your image, say 400, 800, and 1200 pixels wide.
—
2. List them in srcset: srcset="img-400.jpg 400w, img-800.jpg 800w".
—
3. Add a sizes hint, like sizes="(max-width: 600px) 400px, 800px".
—
4. Keep a normal src as a fallback for old browsers.
—
5. Reload on your phone and desktop to confirm each gets a different file.

The browser now downloads only what the screen needs.

Try this: Make a 400px version of your hero and add it to a srcset.
Этот пост опубликован в Telegram-канале Vitals 101. Подписаться можно по ссылке: @CoreVitals101.
tech

Свежие посты в категории «Tech Infrastructure»

Все каналы категории →

start

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.