Design a service that accepts image uploads or source URLs, generates resized thumbnails and variants (webp, jpeg), stores them in object storage, and serves URLs with caching. Handle async processing for large images and dedupe by content hash.
Functional requirements
- Submit image and request target dimensions or presets
- Return job id for async processing or sync for small inputs
- Serve stable CDN URLs for each variant
- Optional smart crop presets (extension: face detection pipeline)
Non-functional requirements
- CPU-bound workers scaled separately from API tier
- Idempotent jobs keyed by (hash, transform spec)
- Cost control on storage and egress