I've recently taken over an ecommerce website (example.com) and I'm looking to make some improvements to how media files are delivered. Currently when an image is uploaded for a product, the process is as follows:
- Image is stored locally
- Metadata is stripped
- Multiple sizes of the image are created for various thumbnails around the website
- Watermark is applied
- Images (including the original) are copied to Digitalocean Spaces and served through CDN
- Local copies are removed
The website also has videos for some products. We currently use Ffmpeg to create thumbnails and use the same flow as above to store.
There are thousands of products so this feels incredibly long-winded and it's not maintainable if we want to add an additional thumbnail size or change the watermark for example.
We use Cloudflare and I know they offer an image optimization service. However, I can't see any way that integrates with Spaces or S3. This will only work with images on the example.com domain. E.g. example.com/w:200,h:200/images/image-01.jpg.
I'm therefore toying with the idea of creating a new subdomain, server and CF zone entirely for images and videos. E.g. media.example.com, moving away from cloud object storage and just storing everything on a linux server with a CDN in front of it. This feels like a bit of a backward step and will be a pretty big task so just wondered whether this is the best solution or if anyone has a better one?