This seems like a bug or missing feature (I know it can be workarounded using DigitalOcean API or
doctl compute cdn flush $cdn_id --files $file
).
The issue is when doing any file changes in DigitalOcean Spaces e.g. uploading an updated file using s3cmd - it is still stuck in CDN with the old file. Why DigitalOcean doesn't automatically purge file from CDN when the file is identified as changed or even removed? For example if https://cdn.mydomain.com/test.jpg doesn't exist, after I upload test.jpg to space https://cdn.mydomain.com/test.jpg would display it without requiring me to purge CDN cache. It is not consistent with case if test.jpg already exist and after I delete it or upload modified test.jpg, now https://cdn.mydomain.com/test.jpg still be stuck with the old file. DigitalOcean should automatically identify change and purge it from CDN cache.