INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Explain the roles of DNS, CloudFront and the origin, then identify checks for path rules, caching and access boundaries.

Prerequisite

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

Public-report example: DNS is not an HTTP forwarding hop
Public-report example: DNS is not an HTTP forwarding hop1: Viewer — Look up the destination name — DNS server. 2: Viewer — Send HTTP(S) after resolution — CloudFront. 3: CloudFront — Request the origin when a fetch is needed — Origin123ViewerDNS serverCloudFrontOriginPublic-report example: DNS is not an HTTP forwarding hop1: Viewer — Look up the destination name — DNS server. 2: Viewer — Send HTTP(S) after resolution — CloudFront. 3: CloudFront — Request the origin when a fetch is needed — Origin123ViewerDNS serverCloudFrontOrigin
  1. Viewer → DNS serverLook up the destination name
  2. Viewer → CloudFrontSend HTTP(S) after resolution
  3. 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.

A fictional site separates delivery from reuse
PathPurposeDesign check
/assets/app.v2.jsPublic versioned JavaScriptReferencing HTML version and freshness.
/catalog.json?lang=jaPublic catalogPartition the key by response language.
/account/Personalized pagesAuthentication and a policy that avoids unsafe shared reuse.

A custom domain needs DNS, an alias and a matching certificate

Three checks for reports.example.com
CheckRoleIf missing
DNS recordResolve the name toward CloudFrontInvestigate resolution first.
Distribution alternate domain nameAssociate the requested hostnameA DNS change alone does not register the distribution alias.
Certificate SANCover the requested hostnameCorrect 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.

One success does not prove every layer
ObservationWhat it establishesWhat remains unknown
DNS returned an answerResolution for that queryTLS, application response and viewer access.
TLS connectedCertificate-related checks for that connectionCorrect body and authorization.
HTTP 200 was receivedThe status of that requestIntended content or guaranteed search indexing.
  1. Identify public/restricted data and the origin.
  2. Select cache and forwarding conditions per path.
  3. Align DNS, distribution aliases and certificate names.
  4. Check viewer and origin HTTPS/access separately.
  5. Verify known content, errors and updates individually.

Read a delivery design by role

Choose an option to see the result and explanation.

Which component delivers the web response to the viewer in the diagram?
Read the answer and reason

Answer: CloudFront · CloudFront serves the HTTP(S) request and fetches from the origin when needed.

Can a public catalog cache policy be reused unchanged for account pages?
Read the answer and reason

Answer: No; review authentication and safe reuse separately · Per-user content requires a different safety analysis from public data.

Does S3 OAC alone restrict CloudFront viewers to employees?
Read the answer and reason

Answer: No; viewer authorization is separate · Origin restrictions and permission for viewers solve different problems.

Check, then explain in your own words

  1. Explain DNS and HTTP connections separately.
  2. Identify safe response reuse per path.
  3. Align DNS, distribution aliases and SANs.
  4. 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.