Report this

What is the reason for this report?

Setting TTL on object in Spaces (Not talking about CDN)

Posted on December 15, 2019

Is there a way to set a TTL at upload time on an object? I use Spaces for logging and don’t want to have to manually make API calls to delete data every few weeks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, Thanks for reaching out to DigitalOcean!

I’m not sure what exactly you mean by TTL value for objects. In general, the TTL value at CDN which will be applied for all the objects. Please refer to below link , which explains on how to setup using CDN:

https://www.digitalocean.com/docs/spaces/how-to/manage-cdn-cache/

However, if you are looking for any object to be deleted after X number of days then you should set the lifecycle rules for Spaces. This can be applied to any folder in your Spaces in which all the objects will be deleted after X days. Here’s our API documentation which will help you in setting lifecycle rules:

https://developers.digitalocean.com/documentation/spaces/#create-bucket-lifecycle

Cheers, Sri Charan

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.