Reputation: 15548
How much maximum cache space allowed per distribution in AWS CloudFront CDN per each POP?
For example:
If I run a 4K video sharing website and each video size is approximately 2GB.
100K users came from same city in one day to watch videos (from 10K video collection) on website.
So, CloudFront need to serve 10,000 different videos for 100K users and each video size is 2GB. So, total 20,000 GB (20TB) of space.
So, Is CloudFront store all that 20TB of content as cache in that specific POP?
Upvotes: 3
Views: 330
Reputation: 269826
I heard once that Amazon Prime Video uses CloudFront and they have videos that get cached in CloudFront, but I have never seen any actual figures published about the size of the cache.
My assumption is that CloudFront caches everything, but older stuff falls off the cache when they run out of space. So, if your videos keep getting watched, they'll stay in the cache.
CloudFront uses a Regional model, so if a cache at the edge does not have content (eg Manchester, England) it will go the cache in the nearest Region (London). If that cache is missing the content, it will go back to the source. So, this means that several edges can benefit from a nearby regional cache, which is more likely to have content since it would receive more 'hits' (and I assume it would also have a larger cache).
If you want to measure how well CloudFront is caching, you can determine whether something was served from the cache by looking for X-Cache: Hit from cloudfront
or X-Cache: Miss from cloudfront
in the page headers.
CloudWatch can also provide a Cache Hit Rate, which provides the proportion of requests that were served from CloudFront edge caches instead of going to origin servers for content.
Upvotes: 2