A website serves static files from an S3 bucket through an Amazon CloudFront distribution. After deploying updated files to S3, the updates are visible in the bucket but not on the site served by CloudFront. What should the developer do to make the new artifacts appear on the site?
Choose an answer
Tap an option to check your answer.
Correct answer: Invalidate the CloudFront cache after deploying the updated artifacts to the S3 origin..
Why this is the answer
The correct solution is to invalidate the CloudFront cache. CloudFront caches content at edge locations to improve performance and reduce latency. When new files are uploaded to the S3 origin, CloudFront continues to serve the old cached content until its Time-To-Live (TTL) expires or the cache is explicitly invalidated. Invalidating the cache forces CloudFront to fetch the latest versions of the files from the S3 origin. Enabling S3 Object Lock is incorrect because it prevents objects from being deleted or overwritten for a fixed amount of time or indefinitely, which is not related to CloudFront caching behavior. Configuring the S3 bucket to delete old objects before uploading new artifacts is unnecessary and doesn't address the CloudFront caching issue. Changing the CloudFront distribution's origin configuration is also incorrect; the origin (S3 bucket) remains the same, only the content within it has changed.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed