AWS CloudFront
- It is a Content Delivery Network
- Improves read performance, content is cached at the edge.
- Global edge locations
- Integration with security services of AWS.
Two types of origin for CloudFront
S3 Bucket
- For distributing files and caching them at the edge
- Enhanced security with CloudFront Origin Access Identity (Only Cloudfront can access data or communicate with S3)
Custom Origin (HTTP)
- Application Load Balancer
- EC2 instance
- S3 website
CloudFront Caching
Cache based on
- Headers
- Session cookies
- Query String Parameter
We can maximize the cache hit rate to minimize requests on the origin
You can invalidate part of the cache using the CreateInvalidation API
CloudFront Security
Viewer Protocol Policy:
- Redirect HTTP to HTTPS
- Or use HTTPS only
Origin Protocol Policy (HTTP or S3):
- HTTPS Only
- Or Match Viewer (HTTP => HTTP& HTTPS => HTTPS)
Enable Geo-Restrictions
0 Comments