Q2 — AWS SAA-C03 Ch.16

Question 2 of 100 | ← Chapter 16

Q1202. A company's packaged application dynamically creates and returns single-use text files in response to user requests. The company is using Amazon CloudFront for distribution, but wants to further reduce data transfer costs.The company cannot modify the application's source code.What should a solutions architect do to reduce costs?

Correct Answer: C. Enable caching on the CloudFront distribution to store generated files at the edge.

Explanation

To reduce data transfer costs for a company's packaged application that dynamically creates and returns single-use text files in response to user requests, while using Amazon CloudFront for distribution and without modifying the application's source code, the most suitable solution is:C. Enable caching on the CloudFront distribution to store generated files at the edge.Analysis:CloudFront Caching: CloudFront is a content delivery network (CDN) that caches content at edge locations around the world. By enabling caching on the CloudFront distribution, you can store the generated single- use text files at the edge locations. This reduces the number of requests that need to be sent back to the origin server (where the application is hosted), thereby reducing data transfer costs. Single-Use Files Consideration: While the files are single-use, enabling caching can still be beneficial if there are patterns in the requests (e.g., multiple users requesting similar files or the same file being requested multiple times within a short period). Even if the files are truly single-use, the caching mechanism can still help in reducing the load on the origin server by serving cached responses for subsequent requests (if any) to the same or similar files. No Source Code Modification Required: Since the company cannot modify the application's source code, solutions that require changes to the application (e.g., compressing files at the application level) are not feasible. CloudFront caching can be configured without any changes to the application, making it a suitable solution.Why the Other Options Are Not Suitable:A. Use Lambda@Edge to compress the files as they are sent to users:Why Not: While Lambda@Edge can be used to modify or transform content as it is sent to users, compressing files at the edge may not significantly reduce data transfer costs if the files are already small (as text files typically are). Additionally, Lambda@Edge involves additional complexity and potential costs, and it may not be necessary if caching can effectively reduce the number of requests to the origin server. B. Enable Amazon S3 Transfer Acceleration to reduce the response times:Why Not: Amazon S3 Transfer Acceleration is designed to speed up the transfer of files to and from Amazon S3 by using optimized network paths. However, it does not directly reduce data transfer costs for files that are being served through CloudFront. Additionally, the scenario describes an application that dynamically creates files, not necessarily files stored in S3. D. Use Amazon S3 multipart uploads to move the files to Amazon S3 before returning them to users:Why Not: Amazon S3 multipart uploads are used for uploading large files to S3 in parts, which can improve upload reliability and speed. However, this solution does not address the issue of reducing data transfer costs for files that are being served through CloudFront. Additionally, the scenario describes an application that dynamically creates files, not necessarily files that need to be uploaded to S3.Conclusion:Enabling caching on the CloudFront distribution to store generated files at the edge is the most effective way to reduce data transfer costs for the company's packaged application, without requiring any modifications to the application's source code.