Specify cache control for S3 content origin. When new content is pushed to S3, it gets refreshed in the edge servers in an hour without having to invalidate the content.
aws $PROFILE s3 cp content s3://$BUCKET/ --recursive --exclude ".git/*" --cache-control max-age=3600
To invaliate all the static content in a CloudFront Distribution, use the pattern in the AWS Console.
/*
References:
- Dynamic Content - http://www.elastic.io/blog/VNiqnCYAAO-gT-lI/how-we-use-amazon-cloudfront-for-dynamically-generated-content
- Docs - http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html#ExpirationDownloadDist
- Docs - http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesObjectCaching