- Newest
- Most votes
- Most comments
CloudFront's cache eviction process is designed to optimize content delivery while managing limited cache space at both Points of Presence (POPs) and Regional Edge Caches. Here's how it generally works:
-
When cache space becomes full, CloudFront may start evicting content, even if it still has a valid TTL (Time to Live). The system prioritizes keeping the most popular and frequently accessed content in the cache.
-
POPs, which are the edge locations closest to viewers, have smaller caches compared to Regional Edge Caches. As objects become less popular, individual POPs might remove those objects to make room for more popular content.
-
Regional Edge Caches have larger cache capacities than individual POPs. This allows objects to remain in the cache longer at the nearest regional edge cache location, even if they've been evicted from a POP. This design helps keep more content closer to viewers, reducing the need for CloudFront to fetch content from the origin server.
-
The eviction process is dynamic and based on various factors, including content popularity, size, and access patterns. CloudFront's algorithms are designed to optimize cache performance and reduce origin load.
-
There is no way to guarantee a specific amount of cache space for a customer. CloudFront's caching system is shared across all users of the service, and the space allocation is managed automatically by CloudFront's algorithms.
To maximize the likelihood of your content staying in the cache:
- Use appropriate TTL settings in your cache policies.
- Implement content versioning by including version identifiers in file names.
- Use Cache-Control headers to provide more precise control over individual pieces of content.
- Consider the size of your objects, as smaller objects are less likely to be evicted quickly.
While you can't reserve cache space, these strategies can help improve the chances of your content remaining cached and reduce the frequency of origin requests.
Sources
How CloudFront delivers content - Amazon CloudFront
Controlling how long Amazon S3 content is cached by Amazon CloudFront - Hosting Static Websites on AWS
Understand cache policies - Amazon CloudFront
Relevant content
- asked 6 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 months ago