AWS CloudFront

Learn about AWS CloudFront, an important AWS content delivery network service.

CloudFront

AWS CloudFront is a CDN, which improves read performance by caching static content in AWS edge locations worldwide. At the time of publication, AWS has more than 400 edge locations and 13 regional edge caches.

When we use CloudFront in front of a website or a bucket, the content of the website or bucket gets cached in edge locations worldwide. The first time the content is accessed, AWS will use its private network to fetch data from the origin to the edge location. Any subsequent request for this data will be served from the edge location and not the origin, thereby improving read access to the content across the world.

In the following illustration, we have an HTTP origin (website hosted on EC2 instances) or an S3 bucket as a CloudFront origin in any AWS Region. CloudFront has cached data in five AWS edge locations, and any user request for the cached data is directly served from edge locations.

So our origin could be in the Sydney region, but because AWS has an edge location in Ireland, European users will have low-latency access to the data.

Press + to interact
CloudFront
CloudFront

Caching in CloudFront

By default, CloudFront doesn’t consider headers, cookies, or query parameters when caching objects and data in edge locations. If an origin returns responses for different cookies, headers, or query parameters, CloudFront caches only one version of the object. This isn’t ideal. So, depending on the application ...