Hi CF community - we would like to move to Digital Ocean’s new CDN, Spaces.
Does anyone know if Spaces is compatible with Cloudflare especially with caching files on Cloudflare’s edge network?
Thanks in advance
Hi CF community - we would like to move to Digital Ocean’s new CDN, Spaces.
Does anyone know if Spaces is compatible with Cloudflare especially with caching files on Cloudflare’s edge network?
Thanks in advance
Hi there. I think there may be some confusion - DO Spaces is just object storage not CDN. Additionally, if you wanted to utilize a CDN for assets stored in a DO Space, you would need to go with a pull-zone type CDN.
I’m not sure if you’re already using DO Spaces, but I have a trial going and it’s very similar to S3/Google buckets in the sense that your assets are given a unique URL such as https://<bucket-name>.nyc3.digitaloceanspaces.com/<asset-name>
. Since these assets are on an external domain there’s no way Cloudflare would be able to cache them.
@anon13938084 can you CNAME to the DO Spaces instance or does it look for the host header in the web request? If CNAME is supported then we could cache it on any given plan, otherwise it would require one which supports host header rewrites (uh… ENT only I think today).
As I understand @cs-cf and @anon13938084, they have not implemented CNAME support yet.
I’m not following @cs-cf how we could cache using host header rewrites. Do you mind elaborating?
So on the Enterprise plane we support a feature called “Host Header Rewrites”. What it allows is for you to set a page rule which says when a user visits something.mydomain.com for Cloudflare to change the host header in the request to origin from something.mydomain.com to a different value (e.g. mybucket.yc3.digitaloceanspaces.com) so that the origin server recognizes the request.
This feature is pretty powerful (and somewhat ripe for potential abuse) and so it’s access is limited to ENT customers who are… most days… less likely to be up to something nefarious.
I believe this is the case. My test can be found here where I have two images in the header. For the CNAME it goes into a 302 loop.
Got it. Thanks for explaining. Yeah, we are on the business plan so would not be able to utilize this feature.
On the plus side we DO, so if there’s a way we can collaborate I am sure there are already smart people on both sides discussing the best way to do it.
@cs-cf and @anon13938084 is there a Cloudflare compatible object/cloud storage you might recommend besides S3?
And agreed @cs-cf on DO. They are saying CNAME support is coming. But we can all show our support to hurry with this feature to their product team by upvotting this document.
I’m using a Google Cloud bucket for images on one of my sites - it’s a static site set up using this method. The HTML for the site is actually hosted via GitHub pages for version control and my Google bucket is setup as an img
subdomain that contains all of my image files. I have this subdomain set up on Cloudflare as a CNAME as outlined in that article and it works just like it did on S3.
Wao deep stuff i just understood the CNAME and container stuff but since Digital Ocean is a storage for assets and is external to Cloudflare from my reading on the topic the header rewrites offered by @cs-cf might be the solution I mean it made sense to my little brain but further test will be needing if the assets are for queries or other databases request which in my opinion are not too friendly with redirection; just an opinion.
This still doesnt seem possible to use the same approach as for S3, since buckets can have dots at DO.
https://www.digitalocean.com/community/questions/hiding-spaces-behind-Cloudflare?comment=66151