AWS Certified Developer – Associate (DVA-C02) — Question 393
A developer manages a website that distributes its content by using Amazon CloudFront. The website's static artifacts are stored in an Amazon S3 bucket.
The developer deploys some changes and can see the new artifacts in the S3 bucket. However, the changes do not appear on the webpage that the CloudFront distribution delivers.
How should the developer resolve this issue?
Answer options
- A. Configure S3 Object Lock to update to the latest version of the files every time an S3 object is updated.
- B. Configure the S3 bucket to clear all old objects from the bucket before new artifacts are uploaded.
- C. Set CloudFront to invalidate the cache after the artifacts have been deployed to Amazon S3.
- D. Set CloudFront to modify the distribution origin after the artifacts have been deployed to Amazon S3.
Correct answer: C
Explanation
CloudFront caches content at edge locations to improve delivery speeds, meaning updated files in Amazon S3 will not be immediately visible to users until the cache expires. Creating a CloudFront cache invalidation forces edge locations to bypass the cached files and fetch the latest versions from the S3 origin. Other options, such as changing the origin or using S3 Object Lock, do not clear the active cache on the edge servers.