Filed in by Megan Meza | February 25, 2011 11:45 am
We’re pleased to announce that Rackspace Cloud Files now supports Edge Purge via the Cloud Files API. This feature allows customers to quickly edit or delete content on the edge server.
When an object is CDN enabled and requested from an end user, the object is cached at the edge. That object remains unchanged, untouched, etc. as long as the TTL or cache control has not expired, no matter what happens at the origin. This is the main principle behind CDNs and what makes them so fast. However, that means that you may have to wait up to 3 days before your content is refreshed.
Let’s say my website is serving (via CDN) a banner that advertises that I’m giving away widgets for the next month. What if my factory is swamped overloaded and we can’t take any more orders? Without Edge Purge, my content is going to live there for 3 days, or I have to upload a new banner and change my website code. That’s a lot of widgets to make! Edge Purge allows me to make changes or delete existing files quickly.
There are two basic ways of accomplishing an Edge Purge. We have chosen to implement what is called “invalidation”. This means that once you request a to purge, your cache control will be flagged as expired. The next time your object is requested, the edge will check back with the origin to see if there have been any updates, and serve the appropriate content.
This method of Edge Purge is exceptionally helpful when you want to purge an entire container. With this method, the objects that have been changed will be re-cached with the appropriate content, but the unchanged objects will be served as normal, at normal speeds. We did not utilize the method in which all objects in the container had to be resent because it increased latency on objects that may have not changed.
Here are some sample calls for purging an object and container…
To purge a given object “foo.txt” in the container “bar”, send the following to the X-CDN-Management-URL:
DELETE /v1/<account-id>/bar/foo.txt HTTP/1.1
That will purge that object from Akamai, and send an email to user@… when it’s done.
To purge an entire container named “bar”, send the following to the X-CDN-Management-URL:
DELETE /v1/<account-id>/bar HTTP/1.1
That will purge all objects in that container from Akamai, and send an email to user@… when it’s done.
Note that the email address for both sample calls is optional, or can be a comma-separated list if you want to notify more than one person.
We have updated our Cloud Files API Developer Guide if you want more details. Let us know if you have any questions regarding Edge Purge, the CDN, or anything else. We are happy to help.
UPDATE: Customers are limited to 25 object purge requests per day. Customers who need to submit a whole container purge request should contact Support. For best practices on when to use purge, please see our knowledge center article: http://www.rackspace.com/knowledge_center/Using_Edge_Purge
Source URL: http://www.rackspace.com/blog/cloud-files-cdn-gets-edge-purge/
Copyright ©2015 The Official Rackspace Blog unless otherwise noted.