CloudFront Flashcards
What is cloudfront and what are the benefits of using it?
Cloudfront is a CDN (content delivery network) that improves read performance by caching its content at the edge of the network, improving users experience. It also prevents from DDoS attacks, since the content is distributed worldwide.
When the user requests content to the edge, if it is not present, it makes a request to the origin and caches the result for future requests.
What are possible cloudfront origins?
S3 bucket
* distributing files and caching them at the edge
* enhanced security with cloudfront origin access control
HTTP (custom origin)
* ALB
* EC2
* S3 website
* Any HTTP backend
What is the difference between cloudfront and S3 cross region replication?
Cloudfront is a global edge network, and S3 you would need to make replications to different regions.
Cloudfront has a cache mechanism for some period of time and on a S3 CRR the replication is asynchronous but near real time.
Cloudfront is great for static content that does not need to be updated constantly. S3 is great for dynamic content.
What is a cache key and how it is used?
Cache key is a unique identifier for every object in the cache. It can be based on many features like HTTP headers, cookies, query string, etc…
What is a cache invalidation?
It is a form of forcing cloudfront to request the origin again and delete the old cache. It is useful when you have new content in the origin and need to refresh the cache. Can be done via API.
What is cloudfront signed URL and how it can be used?
A policy can be attached with:
* URL expiration
* IP ranges to access data
* trusted signers
A use case can be when you want to distribute paid shared content to premium users over the world
How cloudfront pricing works?
Pricing is based on data out the edge locations and how many edge locations are active. The edge locations are divided in classes of pricing.
How cloudfront multiple origin works?
On a same cloudfront, you can access different origins based on the path being accessed.
What are cloudfront origin groups?
Are used to high availability and failover. If the primary origin fails, the second origin is used.