Since there were questions about CDN and S3 I thought I would share this extension that I made some time ago. I really only built out the pieces that applied to what I needed, so it’s a pretty basic adaptation.
Happy to answer any questions or look at expanding functionality if needed.
Further to my second question, I did find a way to delete all images in an S3 folder, but I had to use the Amazon S3 PHP SDK class that includes a method called ‘list_objects’.
This method supports a ‘prefix’ option that allows you to filter all objects by a particular folder (matching the prefix) and then once you have this subset, you can delete the individual files using ‘delete_object’.