AWS Certified Solutions Architect – Associate (SAA-C02) — Question 594
A company is hosting its website on Amazon S3 and is using Amazon CloudFront to cache content. The company has an upcoming product launch. An employee accidentally published marketing content to the website before the official release of the product. The company needs to remove the marketing content from the website as quickly as possible.
Which solution will meet these requirements?
Answer options
- A. Deploy the updated version of the website to another S3 bucket. Update the origin for CloudFront.
- B. Delete the marketing content in the existing S3 bucket. Invalidate the file path in CloudFront.
- C. Create a new CloudFront cache policy with a low TTL. Associate the new policy with the existing CloudFront distribution.
- D. Delete the marketing content in the existing S3 bucket. Update the S3 bucket policy to block requests to the file path.
Correct answer: B
Explanation
Deleting the object from the source Amazon S3 bucket ensures that it cannot be retrieved again, while executing a CloudFront invalidation immediately removes the cached version of the files from all edge locations. Other methods, such as updating cache policies to lower TTLs, only apply to future requests and will not immediately purge already cached content. Modifying the S3 bucket policy or changing the origin does not resolve the issue quickly because CloudFront will continue to serve the cached, leaked content from its edge caches until the TTL expires.