"You can also use presigned URLs with the Spaces CDN. To do so, configure your SDK or S3 tool to use the non-CDN endpoint, generate a presigned URL for a GetObject request, then modify the hostname in the URL to be the CDN hostname (<space-name>.<region>.cdn.digitaloceanspaces.com, unless the bucket uses a custom hostname)."
This only works for "Virtual-hosted style file URL" type urls, it does not work for "Path-style file URL". That tripped me up because I had forcePathStyle: true in my s3 client. I can see questions where other people have likely run into the same issue and it has not been explained correctly. See below:
Then there is this:
"Using presigned URLs does not allow transferred files to be cached when using the Spaces CDN. Attempting to do so may result in double the bandwidth charge without the CDN’s performance benefit."
This appears contradictory to the first section. If presigned URLS cannot be cached, does that mean there is zero performance benefit in using presigned urls with the spaces CDN? In my mind, a CDN _is_ an edge cache. In this context, I do not understand the difference between the cache and the CDN itself.
I see another person has had the same point of confusion and it hasn't really been fully addressed: https://ideas.digitalocean.com/documentation/p/confusing-phrasing-around-presigned-urls-caching-and-cdns
Thanks