How Do You Cache S3 Video Files at CloudFront Edge Locations?
Short answer
B Configure a CloudFront cache behavior matching the video URL path pattern to route requests to the new Amazon S3 origin for edge caching.
Question
A CloudOps engineer needs to ensure that video files can be cached at edge locations after the company migrates the files to Amazon S3.
Which solution will meet this requirement?
Key Takeaways
The exam tests whether you know CloudFront cache behaviors—not headers, signed URLs, or origin groups—select the origin and cache settings for a given URL path; the trap is confusing access control or failover features with content routing.
Moving video files to Amazon S3 while keeping CloudFront caching requires adding S3 as an origin and creating a cache behavior that matches the video URL path pattern. This page confirms option B and explains why header forwarding, signed URLs, and origin groups do not provide path-based origin routing.
Common mistake: A common mistake is choosing an origin group (D) because it mentions a secondary origin, but origin groups only provide failover based on HTTP status codes; they do not route video path patterns to S3 for edge caching.
Expert Analysis
Why the Answer Is Correct
CloudFront decides both the origin and the cache settings for each request through cache behaviors, and each behavior is tied to a URL path pattern. By adding the S3 bucket as a new origin and creating a cache behavior whose path pattern matches the video files, the distribution sends video requests directly to S3 while leaving ALB-backed requests on their existing behavior. That design is exactly what lets the video files be cached at edge locations after migration, because the objects are now fetched through a CloudFront cache behavior rather than through the ALB. Option B therefore satisfies the requirement with the native CloudFront routing and caching mechanism.
Why the Other Options Are Wrong
Option A focuses on forwarding the X-Forwarded-For header and redirecting requests, but header forwarding does not create a cache behavior for S3 and a redirect is not the same as associating S3 as a cacheable origin. Option C uses signed URLs and a custom policy, which control who may access content rather than how CloudFront routes and caches it from S3; signing alone does not add the video path to an S3 origin. Option D configures an origin group, but origin groups are failover constructs that use HTTP status codes to switch to a secondary origin, not a path-pattern routing mechanism for normal video caching. None of these alternatives establishes the necessary S3 origin plus cache behavior for the video URL path.
Community Comment Notes
As Bad_Mat noted, the correct approach is to route to Amazon S3 as a new origin and match a URL path pattern for the video files. The explanation emphasizes adding S3 as a distinct origin alongside the ALB and defining a specific cache behavior path pattern so video requests pull and cache directly from S3. No commenter argued for the header-forwarding, signed-URL, or origin-group options, and the community reasoning aligns with the CloudFront cache behavior model.
Official Reference
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesCacheBehavior.html
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html
These links open the official vendor documentation in a new tab.
Exam Strategy
When a CloudFront question asks about serving or caching content from a new source, separate routing and caching features from access control and failover features. Look for a cache behavior with a URL path pattern and an origin, and reserve signed URLs for authorization and origin groups for failover scenarios.
Frequently Asked Questions
Why isn't a CloudFront origin group the right choice for moving videos to S3?
Does URL signing help cache video files at CloudFront edge locations?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
Bad_Mat 👍 1 Answered BThe correct solution is B. Configure a new CloudFront cache behavior to route to Amazon S3 as a new origin, based on matching an URL path pattern. Adding Amazon S3 as a distinct origin alongside the Application Load Balancer (ALB) and defining a specific cache behavior path pattern ensures video requests pull and cache directly from S3.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SOA-C03 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SOA-C03 Practice Test →