Please enable JavaScript.
Coggle requires JavaScript to display documents.
Caching - Coggle Diagram
Amazon CloudFont
- All-in-one cache handling solution
- Works with S3, ELB, API Gateway, HTTP/s requests
- 215+ edge locations and 13 regional edge caches globally
S3 Caching
Origin Access Control (OAC)
- Allow/block ranges of IP addresses from accessing the original data (S3, HTTP/s)
- OAI is replaced if applied
Origin Access Identity (OAI)
- Restrict access to S3 only from CloudFront
- May can add write permission to S3, so CloudFront can upload data to S3 (but this is less efficient than direct upload)
Static Website Hosting
- By enabling Static Website Hosting on S3 bucket, the static contents can be cached in CloudFront
Bucket Name Propogation
- When a new S3 bucket is created, it takes up to 24 hours for the bucket name to propagates across all AWS Regions
- Regional endpoints may return 307 Temporary Redirect during the propagation if the endpoint is in the different region than the bucket's region.
Video On Demand (VOD)
- CloudFront can cache VOD or live streaming through AWS Media Services
HTTP/s caching
Custom Header
- When edge locations send request to the original data sources, a custom header can be attached
- Use it to prevent users from directly accessing the original sources bypassing the CloudFront
Custom Error Page
- A custom error page can be stored in S3 bucket
- If an error occurs while getting data from original sources, the stored error page will be returned instead
Origin Groups
- CloudFront can sent request to the group of original resources, instead of just one
- If one of the original sources fail, CloudFront can retry with another resources in the group
Geo Restriction
- Allow/block access to edge locations based on the IP-address with their country
Pricing
All
- Every available edge locations
Class 200
- Include South Africa and East/SouthEast Asian countries
- Most of the regions except the expensive regions
Class 100
- North America and Europe
- Least expensive
Signed URL
- Client can retrieve Signed URL from CloudFront
- CloudFront deliver appropriate data from original data sources
-
Edge Function
- Customize cache behavior by deploying functions to the edge locations
CloudFront Function
- Runs on Edge Locations
- Modify viewer request and response before forwarding them to the original data source
- Closest to the client
- Request and response from the original data source cannot be modified
Lambda@
Edge
- Runs on Regional Edge Locations in major AWS Regions
- Can modify both viewer and origin request and response
- Execution time can be longer than CloudFront Function
Use cases
S3 User-Agent based routing
- Viewer request's user-agent can be checked and can be forwarded to the appropriate objects
Authentication/Authorization
- Viewer request can be checked before sent to the origin
S3 Location based routing
- Modify the origin request, so it can be sent to the different regions based on the client location
AWS Global Accelerator
- Two global static public IPs are provided that can be associated with endpoints (ELB, EC2, etc.)
- It's a proxy that forward traffic to the endpoint depending on various factors: closest to the user, health status, traffic weight
Supported endpoints
- ALB
- NLB
- EC2 instances
- Elastic IP addresses