What is CloudFront?
Amazon CloudFront is a Content Delivery Network (CDN) that improves website performance by caching content at multiple edge locations worldwide. Whenever you see CDN in an AWS exam, think CloudFront.
Key Benefits of CloudFront
- Improved Read Performance – Content is cached at edge locations, reducing latency for users globally.
- Lower Latency – Users access content from the nearest edge location, improving load times.
- DDoS Protection – Since content is distributed worldwide, CloudFront helps mitigate DDoS attacks.
- Global Reach – CloudFront operates with 216+ points of presence (PoPs) globally, and AWS continues expanding them.
How CloudFront Works
- A user requests content from a CloudFront edge location near them.
- If the content is cached, CloudFront serves it immediately.
- If not cached, CloudFront retrieves the content from the origin server (e.g., an S3 bucket, an EC2 instance, or an Application Load Balancer).
- The content is then cached at the edge location for future requests.
Example Use Case
- Suppose you host a website in an S3 bucket in Australia.
- A user in the U.S. requests access.
- CloudFront fetches the content from Australia and caches it at a U.S. edge location.
- The next U.S. user gets the content directly from the cache, avoiding a long trip to Australia.
CloudFront Origins
CloudFront supports various origin servers, including:
- Amazon S3 Bucket – Used for distributing static files.