I realize that s3cmd is for S3 commands (duh), but we’ve been using s3cmd to upload graphics from our server to a bucket which then get pushed out to our CDN on CloudFront. With new files, they push out right away. But when we overwrite files in our bucket, we have to manually invalidate them on CloudFront (http://aws.amazon.com/about-aws/whats-new/2010/08/31/cloudfront-adds-invalidation-feature/)


Maybe it’s opening Pandora’s box to add a feature like this to s3cmd, but do you have any plans to add CloudFront invalidation as an option so I don’t have to use a second tool just to update content on our CDN?






From: Jobe Bittman [mailto:jobe@opencandy.com]
Sent: Thursday, November 04, 2010 10:01 PM
To: s3tools-general@lists.sourceforge.net
Subject: [S3tools-general] Patches for updating headers without re-uploading


I modified s3cmd 1.0.0-rc1 to allow replacing headers such as Cache-Control without having to reupload the file. I'm updating about 400,000 files with this right now. I used the information here http://doc.s3.amazonaws.com/proposals/copy.html and proxy sniffing BucketExplorer to figure it out. Can someone take a look and check it in? I've seen alot of people looking for this functionality on the net.

Try it out. Dump some image on S3 and try the command below.

s3cmd replace --acl-public --add-header "Cache-control: max-age=300" s3://media.aws.com/test.png
wget -S http://media.aws.com/test.png
s3cmd replace --acl-public --add-header "Cache-control: max-age=400" s3://media.aws.com/test.png
wget -S http://media.aws.com/test.png

You should see headers are updating without having to reupload the file. It copy's an s3 object to a new object in s3 and adds the headers.

Jobe Bittman