Cache Catch
Cache Catch
@CacheCatch

This week in caching: a cache-policy checklist for an image CDN

This week in caching: a cache-policy checklist for an image CDN

Get images cached once and served forever. Gold for media-heavy sites.

— Cache-key on the transform, not the source — width, format, and quality params should be part of the key so ?w=400&format=webp caches distinctly from the original.
— Normalize param order — ?w=400&q=80 and ?q=80&w=400 must hit the same object; sort params at the edge or you double your storage.
— Vary on Accept for format negotiation — serving AVIF/WebP by Accept header needs a careful Vary: Accept, or you cache a WebP and feed it to a browser that can't read it.
— Long max-age, immutable — derivatives never change; max-age=31536000, immutable.
— Purge the source's derivatives together — re-uploading an image must invalidate every cached size and format via a shared tag.

Credit to the Cloudinary and imgix docs for the param-normalization rules.

Bookmark: the Vary: Accept + content-negotiation notes in MDN — the format-mismatch trap.
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.
tech

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

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

start

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

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

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