Hand-coded srcset vs image-CDN auto-resize
Both ship the right pixels per device. Maintenance vs runtime cost.
—
Manual srcset + sizes: zero runtime dependency, full control. But every breakpoint is hand-maintained; one wrong sizes value over-fetches ~2-4x bytes.
—
Image CDN (on-the-fly resize + format): correct width and AVIF/WebP by Accept header automatically. Adds a third-party origin (preconnect ~80ms) and per-image cost.
For a fixed design, static srcset is leaner; for user-uploaded media at scale, the CDN wins.
Takeaway: a wrong sizes attr over-fetches ~3x; a CDN auto-fixes it for one preconnect.
Millisecond Mafia
@MillisecondMafia
Hand-coded srcset vs image-CDN auto-resize
Этот пост опубликован в Telegram-канале Millisecond Mafia. Подписаться можно по ссылке: @MillisecondMafia.