Amazon CloudFront Essential2008年〜
A CDN service that delivers content at high speed from edge locations around the world
What It Does
Amazon CloudFront is a CDN (Content Delivery Network) service that delivers content such as web pages, images, videos, and API responses from edge locations (delivery points) distributed worldwide, serving users from the nearest location. By caching content from origin servers (like S3 or EC2) at the edge, it simultaneously improves loading speed and reduces the load on origin servers.
Use Cases
CloudFront is used wherever you need fast content delivery: high-speed static website hosting, video streaming, API response acceleration, software download distribution, live event broadcasting, and reducing latency for globally deployed applications.
Everyday Analogy
Think of it like a convenience store delivery network. Shipping products directly from the factory (origin server) takes time, but if you stock products at convenience stores (edge locations) nationwide, customers can pick them up immediately at their nearest store. Popular items are kept in stock (cached) at each store, and restocked from the factory when sold.
What Is CloudFront?
Amazon CloudFront is a global CDN service provided by AWS. With over 400 edge locations worldwide, it routes user requests to the geographically nearest edge location. This means a user in Tokyo receives content from a Tokyo edge, while a user in New York gets it from a New York edge, minimizing latency caused by physical distance.
Key Features
Beyond caching, CloudFront offers automatic HTTPS support, DDoS protection (AWS Shield Standard is integrated for free), access control, real-time logs, and more. With Lambda@Edge and CloudFront Functions, you can run custom logic at edge locations. For example, you can handle URL rewrites, header additions, and A/B test routing right at the edge.
Origin Types
CloudFront origins (where content is fetched from) can be S3 buckets, EC2 instances, Elastic Load Balancing, API Gateway, or even any HTTP server outside AWS. When using S3 as an origin, you can configure OAC (Origin Access Control) to restrict access so that S3 is only accessible through CloudFront, keeping your S3 bucket private. You can find related technical books on origin types at Amazon.
Getting Started
To start using CloudFront, click "Create Distribution" in the CloudFront console. Specify an origin (such as an S3 bucket or EC2 instance), select a cache policy, and your distribution will be created in minutes. You can access your content via the issued CloudFront domain name (xxx.cloudfront.net). To use a custom domain, configure DNS with Route 53.
Things to Watch Out For
- Incorrect cache TTL settings can cause stale content to be served after updates, so design your caching strategy carefully
- Pricing is based on data transfer volume, so estimate costs in advance if you expect high traffic
- Disabling cache in development environments ensures changes are reflected immediately