In the spirit of the holiday season, I’m sharing some tips and features of our cloud that you may not know about. In this countdown I’ll have 24 posts for you, each covering a single topic or feature about Rackspace Cloud products. We’ll post one per day so keep checking back!
If you’re using Cloud Files for object storage in your application you’re likely ahead of the curve when it comes to cloudy architecture. Good for you. However, in this example let’s discuss what happens when instead of uploading your latest hilarious meme to a container to deliver over the CDN, you upload last year’s tax return. OOPS: that’s a lot of personal information speeding around the globe in record time. In this post, I’ll walk you through how to purge that object from the CDN.
First, to understand this post you need to know how a CDN works. We partner with Akamai and our customers use their CDN for content delivery. They have nodes all over the world. When a user in London requests a file from your Cloud Files container in Chicago, a node in London requests the object and caches it for subsequent requests. It will keep serving that object from the node in London until the TTL expires, EVEN IF YOU DELETE THE OBJECT FROM CLOUD FILES. That’s a big problem for our tax return example. Luckily, you can send a request to purge the object from every node’s cache. You can purge up to 25 objects per day.
To purge an object, send a DELETE request:
curl –s –X DELETE –H “X-Auth-Token: $TOKEN” https://cdn.clouddrive.com/v1/1234/CONTAINER_NAME/OBJECT_NAME
You can also add an email address to be notified once the purge is complete with another header:
-H “X-Purge-Email: email@example.com, firstname.lastname@example.org”
The day is saved! Check back tomorrow for more tips and tricks!