Amazon CloudFront
What is it?
Amazon CloudFront is AWS's content delivery network (CDN) that caches and serves your content from locations close to users worldwide.
Explain like I'm 5
Why was it created?
Serving everything from one region is slow for distant users. CloudFront was built as AWS's CDN to cache content near users and reduce origin load.
Where is it used?
- Serving static assets fast
- Caching websites globally
- Delivering video and downloads
- Accelerating and protecting APIs
Why should developers care?
CloudFront is the default CDN for AWS-hosted sites and apps, so cloud and front-end engineers commonly configure it.
How does it work?
CloudFront caches your content at edge locations worldwide. A user's request is served from the nearest edge; on a cache miss, the edge fetches from your origin (like S3 or a server) and caches it for next time.
Real-world example
A site stores images in S3 and serves them through CloudFront, so a user far from the origin still gets fast loads from a nearby edge.
Common use cases
- Global content delivery
- Caching S3 or app content
- Video and large-file delivery
- Edge security and acceleration
Advantages
- Faster loads for distant users
- Reduces origin load
- Integrates with AWS (S3, etc.)
- Edge security features
Disadvantages
- Cache invalidation complexity
- Risk of stale content if misconfigured
- Added cost
- Configuration learning curve
When should you use it?
When serving content to a geographically spread audience, especially from AWS origins.
When should you avoid it?
For purely dynamic, per-user responses that can't be cached, or a tiny local audience.
Alternatives
Related terms
Interview questions
Beginner
- What is CloudFront?
- What is an edge location?
Intermediate
- How does CloudFront work with S3?
- What is cache invalidation?
Senior
- How would you set cache behavior for mixed static/dynamic content?
- How does a CDN help availability under spikes?
Common misconceptions
- "CloudFront hosts your site" — it caches and delivers content from an origin like S3 or a server; the origin holds the source.
- "A CDN speeds up all content" — it mainly helps cacheable content, not unique per-user responses.
Fun facts
- CloudFront is AWS's implementation of the general CDN concept.
- It pairs naturally with S3 to serve static sites and assets globally.
Timeline
- 2008 — Amazon CloudFront launches
Learning resources
Quick summary
Amazon CloudFront is AWS's CDN, caching content at global edge locations to serve users quickly and offload the origin.
Cheat sheet
- AWS's content delivery network
- Caches at global edges
- Pairs with S3 and origins
- Speeds static content, offloads origin