s3cmd – how to put files with expiration on S3/CloudFront #AWS #s3

[bash]s3cmd put –add-header "Cache-Control: 604800" -P ./* s3://mybucket.com/path/to/files/[/bash]

If you have your CloudFront Distribution pointed to your S3 bucket, files will expire after the number of seconds specified in Cache-Control have passed.

You will need the wonderful s3cmd tool

Leave a Reply

Your email address will not be published. Required fields are marked *