Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference in AWS CloudFront Maximum TTL and Default TTL cache behavior

AWS CloudFront default cache behavior allows customizing Min TTL, Max TTL and Default TTL value. I repeatedly went through the documentation but could not understand what is actual difference between Default TTL and Maximum TTL. For example, if I give 24 hours (in seconds) in Default TTL then what happens to a different duration I apply in Max TTL?

like image 793
Vishal Avatar asked Jan 04 '23 13:01

Vishal


1 Answers

From what I can see:

  • Default is used when the cache control headers do not provide a caching duration
  • Maximum can override the cache control headers by enforcing a shorter caching duration

For example, if the application sets the caching duration to 90 minutes via the headers, but the Maximum TTL is set to 60 minutes, then CloudFront will cache for 60 minutes.

See documentation: Specifying How Long Objects Stay in a CloudFront Edge Cache (Expiration)

like image 163
John Rotenstein Avatar answered Jan 13 '23 11:01

John Rotenstein