Consider a file which is published to Rackspace Cloud Files. If I update this file at noon, how long does it take to migrate to the edge CDNs? Does the CDN only expire the file based on the container's TTL, or does Cloud Files notify the CDN the moment a file has changed?
During development, a user can edit/update a set of images/files and the updated files are pushed to Cloud Files (with the same file name). I'd like to at that point ensure that the file is pushed out to the edge CDNs. I've read up on purging and I don't think that's the proper use case. I've also read up on TTL and I don't think it's appropriate to set the container to a low TTL as these images won't change very often. But when they do change, I expect the change to cascade quickly to the edge CDNs.
Options
The way a CDN works is that when the first request for a file is made, the resource gets retrieved from the origin server. The resource gets cached on the CDN's edge server during response before it gets delivered to the client. Therefore, upon subsequent requests the resource will be delivered via the CDN.
This means that if you have an image being delivered from an edge server and then make a change to that image on your origin server, the old image will continue to be delivered via the CDN until you do one of the following:
Some CDN providers offer the option to use a push or pull zone (see the difference here). Therefore it depends on which method you are using. If you implement a push zone where you manually upload all of your files to be hosted on the CDN's storage cloud then file name versioning is your best option. If you are using a pull zone which automatically detects your static assets and rewrites the url to reflect the CDN URL, then purging the asset after it is edited is likely your best option.