Amazon CloudFront

· Updated · 2 min read · AWS Networking and Content Delivery · Cloud service

Content Delivery Network #

Amazon CloudFront is a content delivery network (CDN) service provided by AWS. It is designed to deliver content, including web pages, videos, images, and other static or dynamic assets, to users with low latency and high data transfer speeds. CloudFront accelerates content delivery by caching it at edge locations distributed globally.

Content Delivery #

CloudFront accelerates the distribution of static and dynamic web content, including HTML, CSS, JavaScript, images, videos, and APIs, to users worldwide.

Global Edge Locations #

CloudFront has a network of edge locations strategically located across the globe. These edge locations cache and serve content to end-users, reducing latency and improving performance.

Low Latency #

By caching content at edge locations, CloudFront minimizes the time it takes for users to access resources, resulting in lower latency and improved user experience.

Scalability #

CloudFront scales automatically to handle varying levels of traffic, ensuring reliable and consistent content delivery even during traffic spikes.

Security #

CloudFront integrates with AWS Identity and Access Management (IAM) and other AWS security services to provide fine-grained control over who can access your content. It supports HTTPS with free certificates from AWS Certificate Manager (requested in us-east-1), signed URLs and cookies, and AWS WAF protection. For an S3 origin, origin access control keeps the bucket private so that content is only reachable through CloudFront.

Customization #

CloudFront allows content customization and delivery control through features like cache control, origin configuration, and compression settings.

Origin Fetching #

Content can be fetched from various origins, including Amazon S3 buckets, EC2 instances or load balancers, or on-premises servers. CloudFront optimizes content delivery by automatically routing requests to the nearest edge location and fetching content from the origin server if necessary.

Streaming #

CloudFront supports the delivery of streaming content, such as live and on-demand video streaming, using protocols like HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH).

Custom Domain Names #

A distribution has a *.cloudfront.net name. To use your own domain, add it as an alternate domain name and create an alias record in Route 53.

CDN Analytics #

CloudFront provides detailed logs and reports on the usage and performance of the content, helping understand user behavior and optimize content delivery.

Pricing #

Pay-as-you-go for data transferred out to the Internet and requests, with a free tier. Traffic between S3 or other AWS origins and CloudFront is not charged. See the CloudFront pricing.

With Terraform #

The resources are aws_cloudfront_distribution, aws_cloudfront_origin_access_control, aws_cloudfront_cache_policy and aws_cloudfront_function.

More tutorials that use CloudFront

#AWS #AWS CDN #AWS CLOUDFRONT