AWS now supports gzipping files through CloudFront
I\'ve followed along with all of the instructions in Serving Compressed Files, and yet gzipping is not working.>
I hit the same error today and solved it by adding a CORS rule to the S3 bucket. This rule ensures the Content-Length header is sent to Cloudfront so content can be gzipped:
S3 > Bucket > Permissions > CORS Configuration
*
GET
3000
Authorization
Content-Length
Credit goes to Robert Ellison: http://ithoughthecamewithyou.com/post/enable-gzip-compression-for-amazon-s3-hosted-website-in-cloudfront
As far I know, this seems to be an undocumented requirement.