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!
Accepted Answer
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.