Want to use a CDN to speed up global delivery of the files you store at DigitalOcean Spaces?
The Media Library Folders Pro S3 add-on lets you offload your WordPress media files to DigitalOcean Spaces and then serve those files up directly from Spaces.
But while serving files directly from DigitalOcean Spaces works fine at a basic level, you can achieve lower latency and faster download times for visitors around the globe by serving the files you store at Spaces via a CDN instead.
Depending on which CDN you choose, you might also end up saving on bandwidth costs, as well.
Beyond that, the same principles that we show you in these two tutorials should apply to almost any origin pull CDN*.
While we will focus on how to do this on WordPress using our Media Library Folders Pro S3 add-on, the basic principles that we'll cover will also apply to any type of site. So even if you're not using WordPress, this guide should still help you out.
*While we showed you how to connect Cloudflare to an Amazon S3 bucket in another tutorial using the free Cloudflare plan, the only way to connect Cloudflare to DigitalOcean Spaces is if you have a paid plan that supports host header rewrites.
To get started, we're going to assume that you've already managed to connect your WordPress site to DigitalOcean Spaces.
If you haven't already, you'll need our Media Library Folders Pro plugin and the Media Library Folders Pro S3 add-on.
Once you have those two plugins, you can follow this guide to connect WordPress to DigitalOcean Spaces.
This is essential because you'll use a separate plugin to rewrite the URLs on your site to use your CDN. Even with this box unchecked, Media Library Folders Pro S3 will continue to offload your WordPress media files to DigitalOcean Spaces.
To get started, go to your KeyCDN dashboard (if you haven't already signed up for KeyCDN, you can do that here).
To get started, go to the Zones tab in your KeyCDN dashboard and create a new zone. Give it a Zone Name (this will be part of the URL where you access your content, if you don't use an alias).
Then make sure the Zone Type is set to Pull.
But once that process finishes, you're almost ready to start using your CDN on your live site.
Once your zone is deployed, all you need to do is rewrite the URLs on your WordPress site to use your CDN rather than the files on your server or DigitalOcean Spaces.
To do that, you can use the free CDN Enabler plugin. Once you've installed and activated the plugin, go to Settings → CDN Enabler in your WordPress dashboard.
And that's it! Your WordPress site should now start serving files from DigitalOcean Spaces via KeyCDN.
StackPath, the company that acquired the once-popular MaxCDN, is another CDN that's easy to integrate with DigitalOcean Spaces.
The process for connecting DigitalOcean Spaces to StackPath is nearly identical to KeyCDN, with just a few interface tweaks.
Name – this will be part of your CDN URL, unless you use an alias.
Original Server URL – this is the URL to your DigitalOcean Space*.
Label – this is purely internal.
Just like with the KeyCDN example, you'll need to finish up by rewriting the URLs on your WordPress site to use StackPath.
The same process that we outlined above should work to connect DigitalOcean Spaces to most other CDNs, as well (with the notable exception of Cloudflare, as previously mentioned).
For any origin pull CDN, you should essentially be able to just paste in your DigitalOcean Space as the origin URL. Then, all you need to do is rewrite the URLs on your WordPress site using a plugin like CDN Enabler.
And if you're still looking for a way to offload your WordPress media files to DigitalOcean Spaces, check out how Media Library Folders Pro and Media Library Folders Pro S3 can help you manage your media library's folder structure and automatically offload your files to DigitalOcean Spaces.