How to Enable the Spaces CDN

You can enable the Spaces CDN either when creating a new Space or on an existing Space’s Settings tab, in the CDN (Content Delivery Network) section.

Once you’ve enabled the Spaces CDN for a Space, you can access the contents of that Space using the edge URL <spacename>.<region>.cdn.digitaloceanspaces.com instead of the origin URL. You can also customize the CDN endpoint with a secure subdomain you own. This lets you use a URL like images.example.com in addition to <spacename>.<region>.cdn.digitaloceanspaces.com.

Enable the CDN During Space Creation

To enable the CDN when creating a new Space, on the Spaces create page, look for the CDN (Content Delivery Network) section.

The CDN section of the Spaces create page

Click Enable CDN. An Edge Cache TTL drop-down menu will appear. This setting determines the amount of time that the content is cached. You can keep the default of 1 hour or choose another value. You can also customize the CDN endpoint with a secure subdomain you own.

Finish choosing the rest of the settings for the Space, then click Create a Space. Once the Space is created, you can modify the edge cache TTL setting and custom subdomain at any time on the Space’s Settings page.

Enable the CDN for an Existing Space

From the control panel, navigate to the Space’s detail page by clicking the name of the Space. From there, click on the Settings tab. The text in the CDN (Content Delivery Network) section will tell you if the CDN is currently Enabled or Disabled for the Space.

To enable the CDN, in the same CDN (Content Delivery Network) section, click Edit. In the options that open, click Enable CDN. When you do, several options for the CDN will appear.

The Settings tab for a Space with CDN settings opened

You can customize the CDN endpoint with a secure subdomain you own using the Use a custom subdomain menu. The Edge Cache TTL determines the amount of time that the content is cached. You can keep the default of 1 hour or choose another value.

When you’re done choosing options, click Save. Once the CDN is enabled, you can return to this page to modify the edge cache TTL setting and custom subdomain.

Disable the CDN

From the control panel, navigate to that Space’s detail page by clicking the name of the Space. From there, click on the Settings tab. The text in the CDN (Content Delivery Network) section will tell you if the CDN is currently Enabled or Disabled for the Space.

To disable the CDN for an existing Space from the control panel, navigate to that Space’s detail page by clicking the name of the Space. From there, click on the Settings tab.

In the CDN (Content Delivery Network) section, click Edit. In the options that open, click Disable CDN and then Save. A confirmation window will open:

The Disable CDN? confirmation window

Click Confirm to disable the CDN, which removes all files and certificates from the edge servers, and all CDN and edge server endpoints.