DVA-C02 Development with AWS Services Practice Question
A company is using Amazon CloudFront to distribute static content from an S3 bucket. The content is updated frequently, but users see stale content. The developer wants to ensure that new content is served as soon as possible after an update. Which action should be taken?
⚠ Common exam trap
Many candidates confuse TTL configuration (which controls how long new objects are cached) with invalidation (which removes already-cached objects), leading them to pick options that only affect future caching behavior without addressing the stale content already served.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create a CloudFront invalidation for the updated files.
CloudFront caches content at edge locations based on TTL settings. When content is updated in the S3 origin, existing cached copies remain stale until they expire or are explicitly invalidated. Creating a CloudFront invalidation for the updated files immediately removes the cached objects from all edge locations, forcing CloudFront to fetch the latest version from S3 on the next request. This ensures new content is served as soon as possible after an update.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable 'Origin Shield' to reduce the number of requests to S3.
Why it's wrong here
Origin Shield acts as an intermediate caching layer positioned between CloudFront edge locations and your origin, primarily designed to reduce direct requests to the origin for cache misses. While it can significantly improve cache hit ratios at the origin and absorb traffic spikes, it does not actively remove or invalidate stale content from CloudFront's distributed edge caches. Therefore, enabling Origin Shield would not force CloudFront to fetch updated files, as existing cached objects would remain until their Time-To-Live (TTL) expires.
- ✗
Set the 'Minimum TTL' to 0 and 'Default TTL' to 0.
Why it's wrong here
Setting the Minimum TTL and Default TTL to 0 in a CloudFront cache behavior instructs CloudFront to always check with the origin for content freshness on *future* requests, effectively disabling caching for new objects or forcing revalidation. However, this configuration change does not immediately purge or invalidate objects already present in CloudFront's edge caches. Existing stale content would persist until its original caching period expires or it is evicted, meaning users would still receive outdated files for a period.
- ✗
Set the 'Object Caching' to 0 in the CloudFront distribution.
Why it's wrong here
Configuring 'Object Caching' to 0 in a CloudFront distribution's cache behavior completely disables caching for the specified path patterns. This means every single request for those objects would be forwarded directly to the origin, bypassing all CloudFront edge caches entirely. While this ensures users always get the latest content, it negates the primary benefits of CloudFront, such as reduced latency and decreased load on the origin, leading to increased operational costs and a slower user experience.
- ✓
Create a CloudFront invalidation for the updated files.
Why this is correct
Creating a CloudFront invalidation request specifically targets and removes specified objects from all CloudFront edge caches globally. Upon successful invalidation, the next request for those objects at any edge location will result in CloudFront fetching the latest version directly from the origin. This is the most direct and effective method to ensure users immediately receive updated content after changes have been deployed to the origin, overriding any existing TTL settings.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.