Start a conversation

CloudFront Turn On Compression

Opportunity Name:

CloudFront Turn On Compression

 

AWS Resource Type:

CloudFront

 

Opportunity Description:

CloudFront can automatically compress text-based content between 1KB and 10MB in size, resulting in reduced data transfer costs and response times. This opportunity identifies suitable content and enables [compression, which is supported by all modern browsers.

 

 

Criteria for Identifying the Opportunity:

CloudFront defines one or more cache behaviors for a given distribution, which apply caching and content delivery policies to content using path-based matching rules.  For example, a cache behavior might be configured for `/images/*` that serves images.  All distributions include a default cache behavior that matches `*` for any content that does not match other configured cache behaviors.

 

The following criteria are evaluated for the distribution as a whole. If any cache behavior on the distribution uses a disqualifying cache policy, the entire distribution is excluded from the opportunity:

  • Compression is currently disabled on at least one cache behavior
  • The distribution is excluded if any of its cache behaviors uses the CachingDisabled managed policy
  • The distribution is also excluded if any of its cache behaviors uses a cache policy whose default TTL, minimum TTL, and maximum TTL are all 0. Only cache policies attached via a Cache Policy ID are evaluated; legacy inline cache settings (behavior-level TTLs configured without a cache policy) are not checked against this criterion

 

 

Potential savings (range in % on annual basis):

Savings cannot be predicted as they are dependent on the specific content being compressed and content usage patterns.

 

 

What happens when the Fixer is executed?

Qualification is evaluated at the distribution level, using the criteria above. Once a distribution qualifies, compression is enabled on the default cache behavior and every additional cache behavior in that distribution, with both GZIP and Brotli compression enabled in any associated cache policies. If a cache behavior’s cache policy is configured as the CachingOptimizedForUncompressedObjects managed policy, it is changed to the CachingOptimized policy. Cache behaviors still using legacy inline TTL and forwarded-values settings (no cache policy attached) are migrated to a new CloudFix-created cache policy with GZIP and Brotli compression enabled.

 

 

Is it possible to rollback once CloudFix implements the fixer?

Yes - the configuration can be manually reverted by disabling compression and associated cache policy compression settings for the affected cache behaviors.

 

 

Can CloudFix implement the fix automatically once I accept the recommendation?

Yes

 

 

Does this fix require downtime?

No

 

Additional Resources:

 

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted
  3. Updated

Comments