Which set of actions should the solutions architect take to increase the cache hit ratio as quickly possible?
Deploy a Lambda@Edge function to sort parameters by name and force them to be lowercase. Select the CloudFront viewer request trigger to invoke the function.
Update the CloudFront distribution to disable caching based on query string parameters.
Deploy a reverse proxy after the load balancer to post process the emitted URLs in the application to force the URL strings to be lowercase.
Update the CloudFront distribution to specify case-insensitive query string processing.
Explanations:
Deploying a Lambda@Edge function to sort parameters by name and convert them to lowercase ensures that all incoming requests to CloudFront have a consistent query string format. This will help increase the cache hit ratio as different cases or orderings of query strings would otherwise lead to cache misses. By invoking this function at the viewer request trigger, the function will process requests before they reach the origin, thus ensuring uniformity in the cache keys.
Disabling caching based on query string parameters would lead to the opposite of the desired effect. This would result in CloudFront caching fewer responses since all requests would be treated as unique regardless of query strings, leading to a further decrease in cache hit ratio and increased load on the origin server.
While a reverse proxy can modify URLs to a consistent format, implementing it after the load balancer adds unnecessary complexity and latency to the architecture. This approach does not directly address the caching behavior of CloudFront and would not efficiently improve the cache hit ratio as it does not preprocess requests before reaching CloudFront.
CloudFront does not support case-insensitive query string processing directly. If query strings are specified in different cases, they are treated as different keys in the cache. Therefore, simply updating the CloudFront distribution to handle case insensitivity will not resolve the inconsistencies in query string formats already affecting the cache hit ratio.