views:

771

answers:

3

Hi there,

is there any way to update files stored on Amazon's CDN service? Seems like it won't take any update of a file we make (eg. removing the file and storing the new one with the same file name as before). Do I have to explicitly trigger an update process to remove the files from the edge servers to get the new file contents published?

Thanks for your help

Matt

+1  A: 

I seem to remember seeing this on serverfault already, but here's the answer:

By "Amazon CDN" I assume you mean "CloudFront"?

It's cached, so if you need it to be updated right now (as opposed to "new version will be visible in 24hours") you'll have to choose a new name. Instead of "logo.png", use "logo.png--0", and then update it using "logo.png--1", and change your html to point to that.

There is no way to "flush" amazon cloudfront.

Thomas
+1  A: 

Set TTL=1 hour and replace

http://developer.amazonwebservices.com/connect/ann.jspa?annID=655

Hml
A: 

Amazon added an Invalidation Feature. This is API Reference.

Sample Request from the API Reference:

POST /2010-08-01/distribution/[distribution ID]/invalidation HTTP/1.0
Host: cloudfront.amazonaws.com
Authorization: [AWS authentication string]
Content-Type: text/xml

<InvalidationBatch>
   <Path>/image1.jpg</Path>
   <Path>/image2.jpg</Path>
   <Path>/videos/movie.flv</Path>
   <CallerReference>my-batch</CallerReference>
</InvalidationBatch>
James Lawruk