Skip to content
English
On this page

CloudFront

Amazon CloudFront is a content delivery network (CDN) that helps deliver static and dynamic web content to users faster than just serving it out of an AWS Region. For example, if you’re hosting a website from a single AWS Region, as a general rule, the farther a user is away from that region, the more network latency they’ll encounter when accessing it. CloudFront solves this problem by caching your content in a number of data centers called edge locations. There are more than 150 edge locations spread out around the world on six continents.

CloudFront works by sending users to the edge location that will give them the best performance. Typically, this is the edge location that’s physically closest to them. CloudFront also increases the availability of your content because copies of it are stored in multiple edge locations.

The more edge locations you use, the more redundancy you have and the better performance you can expect. As you might expect, the price of CloudFront increases as you utilize more edge locations. You can’t select individual edge locations. Rather, you must choose from the following three options:

  • United States, Canada, and Europe
  • United States, Canada, Europe, Asia, and Africa
  • All edge locations

To make your content available via CloudFront, you must create a distribution. A distribution defines the type of content you want CloudFront to cache, as well as the content’s origin—where CloudFront should retrieve the content from. There are two types of distributions: Web and Real-Time Messaging Protocol (RTMP).

Web A Web distribution is the most common type. It’s used for static and dynamic content such as web pages, graphic files, and live or on-demand streaming video. Users can access Web distributions via HTTP or HTTPS. When creating a Web distribution, you must specify an origin to act as the authoritative source for your content. An origin can be a web server or a public S3 bucket. You can’t use nonpublic S3 buckets.

RTMP The Real-Time Messaging Protocol (RTMP) delivers streaming video or audio content to end users. To set up an RTMP distribution, you must provide both a media player and media files to stream, and these must be stored in S3 buckets.

Amazon CloudFront is a global content delivery network (CDN) service. This service:

  • Accelerates delivery of your websites, APIs, video content, or other web assets.

  • Automatically routes requests for your content to the nearest edge location, so it delivers content with the best possible performance.

Is optimized to work with other services in AWS, such as:

  • S3

  • EC2

  • Elastic Load Balancing

  • Route 53

  • Non-AWS origin server that stores the original definitive versions of your files

  • Lowers the cost of using S3. Data transfer out costs and operations costs (PUTs and GETs) are cheaper than S3 alone; this will speed up S3 performance by adding a caching layer and reduce S3 costs.

  • Lowers the cost of EC2 and other resource uses—again by lowering data transfer out fees but also reducing the load on the back end.