Ensure that your Amazon Cloudfront Content Delivery Network (CDN) distributions are optimized for cost and speed by enabling automatic compression of web content. When compression is enabled, web files are smaller and therefore faster to download, resulting in faster rendering of web pages for users. Additionally, sending compressed files to viewers is less expensive than sending uncompressed files, as the cost of Cloudfront data transfer is based on the total amount of data served. AWS Cloudfront automatically compresses files of certain types for both Amazon S3 origins and custom origins. Be sure to configure your distributions to automatically compress content for web requests that include "Accept-Encoding: gzip" in the request header to maximize performance and reduce bandwidth costs.
To ensure that your Amazon CloudFront web distributions are configured to compress objects automatically and improve web application performance, follow these remediation steps:
By enabling automatic compression for your CloudFront web distributions, you can reduce the amount of data transferred between CloudFront and your viewers, which can lead to faster page load times and lower bandwidth costs. AWS CloudFront compresses certain types of files for both Amazon S3 origins and custom origins.