AWS Certified Developer – Associate — Question 205
A developer is building an application that supports multiple languages. The directory structure and file names for all versions of the website are identical. When a user views the website, the preferred language is added as a query string parameter. The following is an example of the URL: http://d111111abcdef2.doudfront.net/main.html?language=de.
The query string is passed to Amazon CloudFront. No matter which language the developer selects, the English page is returned. If the developer accesses the website directly and bypasses CloudFront. the page works as expected
What should the developer do so that the content of the page matches the language that the developer selects?
Answer options
- A. Create a new CloudFront origin request policy. Set the query string option to All. Update the CloudFront distribution to use the new cache policy.
- B. Create a new CloudFront cache policy. Set the minimum and maximum TTL to 1 hour. Update the CloudFront distribution to use the new cache policy.
- C. Create a new CloudFront cache policy. Set the query string option to None. Update the CloudFront distribution to use the new cache policy.
- D. Create a new CloudFront cache policy. Set the query string option to Whitelist, and include the language string. Update the CloudFront distribution to use the new cache policy.
Correct answer: D
Explanation
The correct answer is D because setting the query string option to Whitelist and including the language parameter allows CloudFront to cache different versions of the page based on the language specified in the query string. The other options either do not account for the query string or set it incorrectly, which would result in CloudFront always serving the default English version of the page regardless of the user's language selection.