Amazon SAA-C03 Exam Preparation

Configuring CloudFront Caching for Query Strings

Prev Question Next Question

Question

You work for a start-up firm developing a new multilingual website to share images and video files.

You are using EC2 instances to host this web application.

To deliver these web content with the lowest latency to end-users, you have configured Amazon CloudFront, which forwards query strings to origin servers based on selected parameter values and caches web content based on these parameter values. During the trial, it was observed that caching was not happening based upon query strings and these requests hit origin servers.

Which of the following need to be checked to see if CloudFront is caching properly based upon query strings? (Select Three)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E. F.

Correct Answers - B, C, E.

CloudFront Query String Forwarding only supports Web distribution.

For query string forwarding, the delimiter character must always be a '&' character.

Parameters' names and values used in the query string are case sensitive.

Parameter Names and Values should use the same case.

Option A is incorrect as CloudFront Query String Forwarding does not support RTMP distribution.

Option D is incorrect as Delimiter Character should always be '&', not '\' character.

Option F is incorrect as in the case of Parameters in the query string, both the parameters' names and values should use the same case.

For more information on Query String forwarding, refer to the following URL-

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html.

To ensure that Amazon CloudFront is caching properly based upon query strings, we need to check the following:

A. Make sure that the distribution is a web distribution, not an RTMP distribution. RTMP (Real-Time Messaging Protocol) is used for streaming media content, whereas a web distribution is used for delivering static and dynamic web content. If we are delivering a website, we need to use a web distribution for CloudFront.

B. Make sure that the delimiter character between query string parameters is a & character. The delimiter character between query string parameters should be an & character, not a & character. The & character is an HTML entity that represents the & character. If we use the wrong delimiter character, CloudFront won't be able to parse the query string parameters correctly.

C. Check if parameters' names and values use the same case. Query string parameter names and values are case-sensitive. If we use different cases for the parameter names and values in the URL, CloudFront won't be able to match the requests with the cached objects.

D. Make sure that the delimiter character between query string parameters is a “/” character. The delimiter character between query string parameters should be an & character, not a forward slash (/). Using a forward slash as a delimiter can cause CloudFront to treat the query string as part of the URL path, which can result in a cache miss.

E. Make sure that the distribution is a web distribution, not an RTMP distribution. As mentioned earlier, we need to use a web distribution for delivering static and dynamic web content.

F. Check only that the query parameter names use the lower case. Query parameter names are case-sensitive. However, CloudFront treats them as case-insensitive by default. If we want CloudFront to treat query parameter names as case-sensitive, we need to configure it to do so explicitly.

Therefore, the correct answers are A, B, and C.