ANS-C01 Question 16
Select 3Your company is hosting a web application that serves dynamic content and static assets, such as images and videos. The application is accessed globally, and you want to improve the end-user experience by reducing latency and offloading traffic from the origin servers. You are also required to support caching based on query string parameters and ensure that unauthorized users cannot access restricted content. Which combination of design patterns should you implement using Amazon CloudFront?
- A
Enable Amazon CloudFront caching and configure cache behaviors to forward query string parameters when caching content.
- B
Configure Amazon CloudFront with signed URLs or signed cookies to restrict access to specific content.
- C
Use Amazon CloudFront's Origin Access Control (OAC) to allow direct access to the S3 bucket origin from the end users.
- D
Configure Lambda@Edge to modify requests and responses to dynamically adjust cache keys and customize user experience.
- E
Use a custom origin server instead of Amazon CloudFront to handle caching and user access control.
Show answer and explanation
Correct answers: A, B, D
Explanation
To optimize performance and reduce latency for a globally accessed application, Amazon CloudFront can be configured to cache content based on query string parameters and restrict unauthorized access using signed URLs or cookies. Additionally, Lambda@Edge can dynamically adjust cache keys and customize responses, further improving user experience. These design patterns leverage the core benefits of a CDN while meeting the requirements for dynamic content handling and content security.
- A. Correct.
Correct: Enabling caching in CloudFront and configuring cache behaviors to forward query string parameters allows you to cache content variants based on specific query strings, improving performance while maintaining dynamic functionality.
- B. Correct.
Correct: Using signed URLs or signed cookies in CloudFront ensures that only authorized users can access restricted or sensitive content, meeting the content protection requirements.
- C. Incorrect.
Incorrect: Origin Access Control (OAC) is used to restrict access to an S3 bucket only through CloudFront, not for direct access from end users. This does not solve the problem of improving latency or caching.
- D. Correct.
Correct: Lambda@Edge can be used to modify requests and responses dynamically, enabling custom caching strategies and better user experience by adjusting cache keys and personalizing content.
- E. Incorrect.
Incorrect: Using a custom origin server instead of CloudFront bypasses the advantages of a CDN, such as reduced latency, caching, and global distribution, which are essential for this use case.