One of the three storage providers this site's upload adapter is written
against — local in development, s3 or cloudinary anywhere the
filesystem is not durable. The adapter exists because writing to
public/img/ works perfectly until the first deploy to a platform that
throws the container away.
The idea worth stealing even if the product is not: a derived asset
should be addressable rather than generated ahead of time. Ask for
w_400,f_auto,q_auto in the URL and the 400-pixel WebP either exists or
is made once — which is the same bargain a
CDN makes about pages, applied to images.