CloudFront distribution has compression turned off
What it checks
CloudFront distribution has compression turned off
Where it applies
Terraform: aws_cloudfront_distribution
CloudFormation: AWS::CloudFront::Distribution
How to fix it
- Inspect the default behavior's content and origin Content-Encoding before enabling compression. CloudFront compresses eligible content types with a Content-Length of 1,000-10,000,000 bytes and response status 200, 403 or 404; compressed origin responses are passed through. Client encoding negotiation matters, and already cached objects are not recompressed by a flag change. Compression remains best-effort.
- For eligible responses, review the existing Terraform default_cache_behavior.compress or CloudFormation DefaultCacheBehavior.Compress. When a cache policy is attached, enable gzip and/or Brotli in its encoding settings (EnableAcceptEncodingGzip / EnableAcceptEncodingBrotli) as appropriate. Validate behavior and refresh cached objects when needed; compare measured bytes and the pay-as-you-go or flat-rate plan before estimating savings.
Frameworks
- AWS Well-Architected COST.8
These mappings are advisory, not an attestation of compliance.