On-the-fly image derivatives
Your task
Design an on-the-fly image thumbnail/derivative service for an image-heavy product (think Pinterest/Shopify) serving 100K image-derivative requests per second across hundreds of size/crop/format variants (WebP, AVIF, JPEG; smart-crop; DPR variants). Originals live in object storage. You cannot pre-generate every variant, the combinatorial space is huge, but cold-start latency must stay low. Design the request path, caching, and how you avoid the thundering-herd when a viral image's variant is first requested.
It covers
- On demand resize
- Cache
- Cdn