Topic lessonTopic: CloudFront: delivery, caching and 403 errors
What is Amazon CloudFront? CDN, origins and caching explained
CloudFront is a CDN that delivers web content through edge locations. It does not replace the source storage or application. Use a fictional public report site to distinguish DNS lookup, HTTPS connections and fetching from an origin when needed.
Explain the roles of DNS, CloudFront and the origin, then identify checks for path rules, caching and access boundaries.
CDN means Content Delivery Network. An edge location serves viewers; an origin supplies source data or application responses. No live AWS connection is required.
DNS lookup is separate from content delivery
- Viewer → DNS serverLook up the destination name
- Viewer → CloudFrontSend HTTP(S) after resolution
- CloudFront → OriginRequest the origin when a fetch is needed
- Viewer
- Resolve a name, then use HTTPS
- DNS server
- Route 53 or another DNS provider
- CloudFront
- Apply delivery and cache rules
- Origin
- S3 or an application server
CloudFront can deliver static and dynamic content. Passing through a CDN is distinct from sharing a cached response. An origin can be S3 or an HTTP server; a distribution holds the CloudFront delivery configuration.
Choose origin and caching conditions per path
A cache behavior applies delivery settings for matching path patterns. Avoid treating every response identically. Identify query parameters, headers and cookies that change the body, and separate key inputs from extra values forwarded to the origin.
| Path | Purpose | Design check |
|---|---|---|
| /assets/app.v2.js | Public versioned JavaScript | Referencing HTML version and freshness. |
| /catalog.json?lang=ja | Public catalog | Partition the key by response language. |
| /account/ | Personalized pages | Authentication and a policy that avoids unsafe shared reuse. |
A custom domain needs DNS, an alias and a matching certificate
| Check | Role | If missing |
|---|---|---|
| DNS record | Resolve the name toward CloudFront | Investigate resolution first. |
| Distribution alternate domain name | Associate the requested hostname | A DNS change alone does not register the distribution alias. |
| Certificate SAN | Cover the requested hostname | Correct DNS does not supply missing name coverage. |
The SAN (Subject Alternative Name) lists certificate names. An ACM certificate for viewer-to-CloudFront HTTPS belongs in us-east-1. CloudFront-to-origin HTTPS is another connection with its own origin name and certificate checks.
Separate origin protection from viewer authorization
For an S3 REST origin, OAC (Origin Access Control) can restrict origin access to authorized CloudFront requests. This does not authenticate viewers as employees. Restricted distribution also needs a viewer authorization design.
| Observation | What it establishes | What remains unknown |
|---|---|---|
| DNS returned an answer | Resolution for that query | TLS, application response and viewer access. |
| TLS connected | Certificate-related checks for that connection | Correct body and authorization. |
| HTTP 200 was received | The status of that request | Intended content or guaranteed search indexing. |
- Identify public/restricted data and the origin.
- Select cache and forwarding conditions per path.
- Align DNS, distribution aliases and certificate names.
- Check viewer and origin HTTPS/access separately.
- Verify known content, errors and updates individually.
Read a delivery design by role
Choose an option to see the result and explanation.
Check, then explain in your own words
- Explain DNS and HTTP connections separately.
- Identify safe response reuse per path.
- Align DNS, distribution aliases and SANs.
- Distinguish OAC from viewer authorization.
Check your understanding: What should you avoid assuming CloudFront solves automatically?
Content correctness, personalized caching, viewer authorization and DNS/certificate alignment.
CDN delivery and each application/configuration responsibility are distinct.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- CloudFront overviewChecked:
Scope and conditionsCDN, origin and edge delivery roles. Documentation review, not live AWS verification.
Used in this lessonDNS lookup is separate from content delivery Read a delivery design by role
Scope and conditionsCache-policy key inputs and TTL settings. Documentation review, not live AWS verification.
Used in this lessonChoose origin and caching conditions per path
Scope and conditionsKey-input forwarding versus extra inputs forwarded outside the key. Documentation review, not live AWS verification.
Used in this lessonChoose origin and caching conditions per path
Scope and conditionsMinimum/maximum/default TTL, validation, early eviction and positive-minimum safety boundary. Documentation review, not live AWS verification.
Used in this lessonChoose origin and caching conditions per path
Scope and conditionsDNS target, distribution alias and certificate SAN are separate checks; certificate wildcard scope. Documentation review, not live AWS verification.
Used in this lessonA custom domain needs DNS, an alias and a matching certificate
Scope and conditionsViewer ACM certificate in us-east-1 versus the separate origin TLS connection. Documentation review, not live AWS verification.
Used in this lessonA custom domain needs DNS, an alias and a matching certificate
Scope and conditionsREST origin/OAC, always-sign behavior and distribution condition; no OAC on website custom origins. Documentation review, not live AWS verification.
Used in this lessonSeparate origin protection from viewer authorization Read a delivery design by role
Scope and conditionsOrigin restrictions and viewer authorization are distinct. Documentation review, not live AWS verification.
Used in this lessonSeparate origin protection from viewer authorization Read a delivery design by role