laurilehmijoki / s3_website

Manage an S3 website: sync, deliver via CloudFront, benefit from advanced S3 website features.
Other
2.25k stars 186 forks source link

Native Gzip Compression Support for Amazon CloudFront #205

Open sparanoid opened 8 years ago

sparanoid commented 8 years ago

Now CloudFront has built-in Gzip support: https://aws.amazon.com/blogs/aws/new-gzip-compression-support-for-amazon-cloudfront/

I think now we can simply use some options like this:

cloudfront_distribution_config:
  compress: true
code-tree commented 8 years ago

I wouldn't take away the existing support though, as there are some downsides to Amazon's builtin compression, like not being able to customise what file types are compressed, and the following:

If you configure CloudFront to compress content, CloudFront removes the ETag response header from the files that it compresses... As a result, when a compressed file expires and CloudFront forwards another request to your origin, your origin always returns the file to CloudFront instead of an HTTP status code 304 (Not Modified). (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html)

Can still add the option though.