TTL and Invalidations

Understand how Amazon CloudFront deals with stale content using time-to-live.

CloudFront’s architecture is centered around caching content at edge locations to enhance content delivery performance and reduce latency for end users. However, this caching mechanism introduces the risk of serving stale data if updates occur at the origin.

Press + to interact
Client accesses the content for the first time
1 / 3
Client accesses the content for the first time

To address this challenge, CloudFront employs the concept of Time-to-Live (TTL).

Time-to-Live (TTL)

Time-to-Live (TTL) refers to the duration for which an object is considered valid and cached at edge locations. When an object’s TTL expires, CloudFront initiates an origin fetch to retrieve the latest version of the object from the origin server. If the object has been updated, CloudFront fetches the updated content from the origin server and refreshes its cache. If the object hasn’t been updated, CloudFront continues serving the cached content. This ensures that users receive up-to-date content, promoting a seamless browsing experience.

CloudFront sets a TTL of 24 hours ...