How to resolve CloudFront serving outdated S3 content?
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?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests the understanding of Content Delivery Network (CDN) caching behavior and the specific mechanism required to force a refresh, contrasting it with S3 configuration options that do not affect the CDN's edge cache.
When content in an S3 origin is updated, CloudFront may continue serving cached versions until the cache expires or is invalidated. The community agrees that creating a CloudFront invalidation is the necessary step to force an immediate update of the cached files.
Selecting option B (clearing old objects) is a common mistake because managing S3 storage does not trigger CloudFront to refresh its edge caches, which operate independently of the origin's file history.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
CloudFront caches content at edge locations to reduce latency. When files in the S3 origin are updated, the edge locations retain the old versions until the Time To Live (TTL) expires. Option C is correct because invalidating the cache explicitly tells CloudFront to remove the old files from the edge locations and fetch the updated versions from S3. This ensures users see the changes immediately rather than waiting for the cache to expire naturally.Why the Other Options Are Wrong
Option A is incorrect because S3 Object Lock is designed to prevent objects from being deleted or overwritten for a fixed amount of time, which is unrelated to CloudFront caching. Option B is incorrect because manually clearing S3 objects before upload does not send a signal to CloudFront to purge its cache. Option D is incorrect because modifying the distribution origin is unnecessary when only the content within the existing origin has changed; this action could even disrupt service.Community Comment Notes
Community comments strongly support option C, citing the specific AWS CLI command for creating invalidations. Commenters highlight that while caching improves performance, it creates a delay in content visibility. The consensus is that invalidation is the standard mechanism to resolve the discrepancy between the origin (S3) and the CDN (CloudFront).Official Reference
Exam Strategy
Remember that CloudFront acts as a middle layer. If the origin changes but the user sees old data, the issue is almost always the cache. Always look for 'invalidation' as the solution for immediate updates, rather than changing origin settings or modifying S3 bucket policies.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →