Section 15: CloudFront Flashcards
What are the possible Cloudfront origins?
- S3 bucket
- Custom Origin (http)
- ALB
- EC2 Instance
- S3 static website
- Any HTTP backend
How is a default Cloudfront Cache Key composed?
The Cache Key consists the hostname and resource portion of the URL (path, without the query params)
What can be used the add other elements to the Cache Key in Cloudfront?
With a Cloudfront Cache Policy you can add other elements (HTTP headers, cookies, query params) to the Cache Key.
What are the minimum and maximum Cache-Control TTL in Cloudfront?
Cloudfront let’s you define a TTL between 0 seconds to 1 year
What is the Cloudfront Origin Request Policy?
The Origin Request Policy let’s you specify values that you want to include in origin requests without including them in the Cache Key
What is the difference between a Cache Policy and an Origin Request Policy in Cloudfront?
A Cache Policy let’s you define how the cache key is composed, while the origin request policy let’s you define which elements (cookies, headers, query params) are send to the origin.
You updated the files in an S3 website bucket and want these changes to reflect in Cloudfront immediately. What can you do?
Invalidate the cache. Either everything (/) or for a specific folder (/images/)
What is a Cloudfront Cache Behavior?
Cache Behavior let’s you configure different settings for a given URL path
pattern. i.e. set the origin for /* to an S3 bucket, but set the origin of /api/* to an EC2 instance.
You want users from a certain country to be blocked by Cloudfront. What can you use?
Cloudfront Geo Restriction
What is an Origin Group in Cloudfront?
An origin group has multiple origins. Cloudfront will try the primary origin from the group, if the connection fails, it will retry the second origin.