AWS Certified CloudOps Engineer Associate SOA-C03 [2026]

Amazon CloudFront Origins, Distributions, Edge Locations, and Behaviors

Study how Amazon CloudFront uses origins, distributions, edge locations, caching behaviors, and policies to improve global content delivery performance.

AWS Certified CloudOps Engineer Associate SOA-C03 [2026]AWS Certified CloudOps Engineer Associate SOA-C03 [2026]Updated Sep 1, 2026
Study options
WatchComing later
ListenComing later
ReadAvailable
ReviewComing later

Study guide

Technical reference and lesson notes

Amazon CloudFront Origins, Distributions, Edge Locations, and Behaviors

Purpose of This Lesson

This lesson explains how Amazon CloudFront improves the performance of delivering files and application content across large geographic areas. The key assessment focus is recognizing the roles of origins, distributions, edge locations, and cache behaviors, and selecting the appropriate configuration for different request paths and content sources.

Key Concepts

  • Content delivery network (CDN): A service that places cached copies of content closer to users to reduce latency and improve performance.
  • Origin: The location where CloudFront obtains content. Examples include Amazon S3, Amazon EC2, an EC2-based application behind a load balancer, or content served from a mounted EFS file system through EC2.
  • Distribution: The CloudFront resource that defines how content is delivered. It provides a CloudFront endpoint and references one or more origins.
  • Edge location: A geographically distributed CloudFront location where content can be cached and served to users.
  • Cache behavior: A distribution rule that uses request characteristics such as path patterns to determine the origin, protocol policy, caching policy, and origin request policy.
  • Custom origin: In this lesson, an origin based on EC2 or EC2 behind a load balancer rather than an S3 origin.

Global Content Delivery Architecture

A typical CloudFront request flow is:

  1. A user requests content through a CloudFront distribution.
  2. CloudFront directs the request to an appropriate nearby edge location.
  3. If the requested object is cached there, CloudFront serves it directly from the edge location.
  4. If the object is not cached or has expired, CloudFront retrieves it from the configured origin.
  5. The content is returned to the user and may be cached at the edge location for later requests.

The origin is located in a single physical region, while edge locations are distributed around the world. This separation allows users in different geographic areas to access cached content from locations that are generally closer to them.

CloudFront reduces the impact of physical distance and may also avoid some of the congestion, routing hops, and oversubscription that can occur across the public internet. When an edge location must retrieve content from an origin, the request uses the AWS global network rather than relying solely on the public internet path.

Origins and Supported Content Sources

CloudFront can use several types of origins:

Amazon S3 Origin

An S3 origin is appropriate when the content is stored as objects in an S3 bucket. This is a common choice for static files such as images, videos, and web assets. An S3-hosted static website can also be used as an origin.

Custom Origin

A custom origin can represent an application or web server running on EC2. The EC2 instances may be placed behind a load balancer, allowing CloudFront to deliver content from an application tier rather than directly from S3.

Content served by EC2 may include application-generated responses, website content, or files available through a mounted EFS file system.

Multiple Origins

A single CloudFront distribution can use multiple origins. For example, one origin can be an S3 bucket for static assets while another is an EC2-based custom origin for dynamic application requests.

The distribution’s cache behaviors determine which origin handles a given request. A path such as /static/* might be directed to S3, while another path such as /api/* could be directed to the custom origin.

CloudFront Distributions and Endpoints

A distribution is the CloudFront configuration object clients use to access delivered content. CloudFront provides a default endpoint using a name similar to:

some-character-string.cloudfront.net

A custom domain name can also be associated with the distribution, allowing users to access content through an organization-owned domain instead of the default CloudFront hostname.

The lecture focuses on CloudFront web distributions. These support HTTP and HTTPS delivery for static and dynamic content. They can also support actions such as adding, updating, or deleting objects and submitting data through web forms, in addition to delivering files and supporting live streaming for real-time events.

RTMP distributions were discontinued and are not available for current use. They should not be treated as an active CloudFront distribution type for this course context.

Cache Behaviors and Request Routing

A cache behavior defines how CloudFront handles requests matching a path pattern. Behaviors can be used to route different types of requests to different origins within the same distribution.

Important behavior settings include:

  • Path pattern: Identifies which requests the behavior applies to.
  • Origin selection: Specifies the S3 or custom origin that should handle matching requests.
  • Protocol policy: Controls how CloudFront handles HTTP and HTTPS requests. A configuration can redirect HTTP requests to HTTPS to avoid unsecured connections.
  • Cache policy: Determines caching-related behavior, including how long objects remain cached and which request characteristics affect the cache key.
  • Origin request policy: Controls the request information sent from the edge location to the origin when CloudFront needs to retrieve content.

The practical design pattern is to create behaviors around application paths. Static content can be routed to an S3 origin, while dynamic or application-specific paths can be routed to EC2 or a load balancer.

Exam- or Assessment-Relevant Takeaways

  • Choose CloudFront when the requirement is to improve global access performance by caching content near users.
  • Distinguish the origin from the edge location: the origin is where CloudFront obtains content; the edge location is where CloudFront serves cached content.
  • A distribution is the CloudFront resource that connects users, behaviors, and origins.
  • CloudFront can use multiple origins, but request routing requires cache behaviors and path patterns.
  • Use an S3 origin for content stored as S3 objects or an S3-hosted static website.
  • Use a custom origin for content served by EC2, including EC2 behind a load balancer.
  • If content is absent or expired at the edge, CloudFront retrieves it from the origin over the AWS global network.
  • HTTP-to-HTTPS redirection is configured through a distribution behavior’s protocol policy.
  • RTMP distributions are discontinued and should not be selected as a current CloudFront option.

Tool / Feature Decision Guide

RequirementAppropriate CloudFront choiceReason
Deliver globally distributed static objects stored in S3S3 originThe content already exists as S3 objects and can be cached near users.
Deliver application responses or website content from EC2Custom originEC2 serves as the source of the content.
Deliver application content through scalable EC2 infrastructureCustom origin pointing to a load balancerThe load balancer represents the application origin and distributes requests across EC2 instances.
Use different content sources for different URL pathsMultiple origins with cache behaviorsPath patterns can route static and dynamic requests separately.
Prevent users from continuing with unsecured HTTP requestsHTTPS protocol policy with HTTP redirectionMatching requests can be redirected to HTTPS.
Let users access content through an organization-owned hostnameCustom domain associated with the distributionThe distribution can be accessed through a custom domain rather than only its default CloudFront endpoint.
Deliver content closer to users around the worldCloudFront edge locationsCached objects are served from geographically distributed locations.

Common Traps / Misconceptions

  • Confusing an origin with an edge location: The origin is not the location closest to the user. It is the source from which CloudFront obtains content.
  • Assuming CloudFront stores the only copy of an object: CloudFront caches content at edge locations, but the origin remains the source when content must be retrieved.
  • Assuming every request always goes to the origin: A cache hit at an edge location can be served without contacting the origin.
  • Treating CloudFront as an S3-only service: CloudFront can use S3, EC2, EC2 behind a load balancer, and other content sources supported as custom origins.
  • Expecting one origin to handle every path: Multiple origins and cache behaviors can route different paths to different sources.
  • Confusing cache policy with origin request policy: Cache policy affects caching decisions and cache-key behavior; origin request policy controls request information forwarded to the origin.
  • Selecting RTMP distributions for a current design: RTMP distributions were discontinued.
  • Assuming geographic proximity is the only latency factor: Distance is important, but routing hops, congestion, and oversubscription also affect latency.

Real-World Engineer / Analyst Notes

  • Design URL paths deliberately when an application will use multiple origins. Clear path separation makes cache behavior routing easier to reason about.
  • Treat static and dynamic content differently. Static assets are natural candidates for S3 and long-lived caching, while application-generated responses commonly require a custom origin and more careful request handling.
  • Review cache duration and request forwarding together. A cache policy that produces poor cache reuse can reduce the performance benefit, while forwarding unnecessary request information can affect how responses are cached.
  • Use HTTPS behavior settings consistently when protecting user and application traffic. Redirecting HTTP requests is a distribution behavior decision, not an attribute of the origin alone.
  • When troubleshooting latency, determine whether the request was a cache hit or a cache miss. A miss requires an origin retrieval and may have a noticeably different performance profile.

Quick Reference Summary

  • CloudFront: AWS CDN for improving global content delivery performance.
  • Origin: Source of the content, such as S3, EC2, or EC2 behind a load balancer.
  • Distribution: CloudFront resource that provides the delivery endpoint and configuration.
  • Edge location: Distributed location that caches and serves content close to users.
  • Cache hit: The edge location has the requested object and can serve it directly.
  • Cache miss or expiration: CloudFront retrieves the object from the origin.
  • Multiple origins: Supported within one distribution.
  • Cache behavior: Uses path patterns and policies to control routing, caching, and protocol handling.
  • Web distribution: Supports HTTP/HTTPS delivery of static and dynamic content, including live streaming use cases described in the lesson.
  • RTMP distribution: Discontinued.

Flashcards

Q: A company stores images and other static files in Amazon S3 and wants users worldwide to retrieve them with lower latency. Which CloudFront origin is the natural choice, and why?

A: Use an S3 origin because the content is already stored as S3 objects and can be cached at CloudFront edge locations closer to users.

Q: What is the decisive difference between a CloudFront origin and an edge location?

A: The origin is the source from which CloudFront obtains content. An edge location is a distributed CloudFront location that caches and serves content to users.

Q: A user requests an object that is not currently cached at the selected edge location. What happens next?

A: CloudFront retrieves the object from the origin, using the AWS global network, and returns it to the user. The object may then be cached at the edge location.

Q: When would you use a custom origin instead of an S3 origin?

A: Use a custom origin when content is served by EC2, including EC2 instances behind a load balancer, rather than being stored as S3 objects.

Q: How can one CloudFront distribution route /static/* and /api/* to different content sources?

A: Configure multiple origins and create cache behaviors with path patterns that route each request category to the appropriate origin.

Q: What is the purpose of a CloudFront distribution?

A: A distribution is the CloudFront resource that defines how content is delivered, identifies origins and behaviors, and provides a CloudFront access endpoint.

Q: Which CloudFront setting can redirect HTTP requests to HTTPS?

A: The protocol policy configured in the relevant cache behavior can redirect HTTP requests to HTTPS.

Q: Compare a cache policy with an origin request policy.

A: A cache policy controls caching behavior, including how long content remains cached and cache-key-related decisions. An origin request policy controls request information sent to the origin.

Q: Why can two users in different countries be directed to different CloudFront edge locations?

A: CloudFront automatically directs users to an appropriate nearby edge location so cached content can be delivered with lower latency.

Q: A design document proposes an RTMP distribution for a new CloudFront deployment. What is the problem?

A: RTMP distributions were discontinued and are not an available current CloudFront distribution type.

Q: Does CloudFront eliminate all sources of latency when serving a cache miss?

A: No. A cache miss still requires an origin request. CloudFront can improve the path by using the AWS global network, but distance, routing hops, congestion, and other network factors still matter.

Q: Why might an application use an EC2 instance behind a load balancer as a CloudFront origin?

A: The application content is served dynamically by EC2, while the load balancer provides the application-facing origin endpoint and distributes requests across instances.

Practice Questions

Question 1

A global application stores product images in S3 but serves customer-specific API responses from EC2 behind a load balancer. The architect wants one CloudFront distribution for both types of traffic. What should be configured?

A. One S3 origin only, with all requests sent to S3
B. One custom origin only, with all requests sent to the load balancer
C. Multiple origins with path-based cache behaviors
D. An RTMP distribution with separate streaming channels

Correct answer: C

Explanation: Multiple origins and cache behaviors allow different URL paths to route to the S3 origin or the custom origin behind the load balancer.

Question 2

Users in several continents report improved performance for an image after it has been requested by another nearby user. Which CloudFront behavior best explains this result?

A. CloudFront permanently moves the origin to each continent
B. The image was cached at an edge location and served locally to later requests
C. CloudFront converts the image into an EC2 volume
D. The distribution changes the S3 bucket’s region automatically

Correct answer: B

Explanation: CloudFront caches objects at edge locations, allowing subsequent users directed to that location to receive the object without an origin retrieval.

Question 3

A security requirement states that users who access a CloudFront URL over HTTP must be redirected to HTTPS. Where should this behavior be configured?

A. In the S3 object metadata only
B. In the origin request policy only
C. In the applicable CloudFront cache behavior’s protocol policy
D. By replacing the CloudFront distribution with an RTMP distribution

Correct answer: C

Explanation: The protocol policy in a cache behavior controls how HTTP and HTTPS requests are handled, including redirecting HTTP to HTTPS.

Question 4

An analyst says that a CloudFront request always travels from the user directly to the origin, so edge locations provide no benefit on cache hits. Which response is most accurate?

A. Correct; edge locations only provide DNS resolution
B. Correct; CloudFront is only a load balancer for EC2
C. Incorrect; a cache hit can be served directly from an edge location
D. Incorrect; CloudFront copies the origin into every AWS Region permanently

Correct answer: C

Explanation: When the requested object is cached at the selected edge location, CloudFront can serve it there without contacting the origin.

WordPress Metadata

Suggested Slug:
amazon-cloudfront-origins-distributions-edge-locations

Meta Description:
Study how Amazon CloudFront uses origins, distributions, edge locations, caching behaviors, and policies to improve global content delivery performance.

Tags:
AWS CloudFront, content delivery networks, CDN, CloudFront origins, CloudFront distributions, edge locations, CloudFront caching, AWS networking, SOA-C03