CloudFront Core Vocabulary
coreintermediateA distribution tells CloudFront where to get content (the origin — S3, an ALB, a custom HTTP server) and how to cache and route it. Cache behaviors match request paths to specific settings; a cache policy controls what varies the cache key (headers, cookies, query strings); an origin request policy controls what gets forwarded to the origin. Edge locations are the worldwide points of presence that actually cache and serve content close to viewers.
Think of it as
A distribution is a franchise agreement — it defines where the "central kitchen" (origin) is and the rules every local branch (edge location) follows for what to keep on hand and how long, so most orders never have to travel back to the kitchen at all.
What we're doing: See how a wide cache key silently collapses a cache's effective hit rate.
- 1
- A header intended for authentication is now also part of what determines a cache hit vs miss.
- 3
- If the underlying response never actually varies by that header for public/cacheable content, this needlessly fragments the cache into near-duplicate entries per unique header value.
Why this works: A cache policy's job is to define exactly what should vary a cached response — including something that does not actually change the response silently destroys cache efficiency, since CloudFront has no way to know the header was irrelevant to the content.
Forwarding every header/cookie/query string "just in case," widening the cache key unnecessarily
Wrong
Better
What you see: Cache hit rate stays surprisingly low despite serving largely identical content, and CloudWatch cache-hit metrics show most requests going all the way to the origin.
Why: Every additional dimension in the cache key (a header, a cookie, a query parameter) multiplies the number of distinct cache entries for what may be identical underlying content — the safe-sounding "include everything" default is exactly what silently defeats caching.
- Viewer request
- leads to Nearest edge location (routed to)
- Nearest edge location — cache hit → served immediately
- leads to Cache behavior match (on a miss, matched by)
- Cache behavior match — by path pattern
- leads to Origin (S3, ALB, custom) (fetches from)
- Origin (S3, ALB, custom) — fetched only on a cache miss
Remember: Distribution ties origins + cache behaviors together. Cache policy = what varies the cache key. Origin request policy = what gets forwarded to the origin on a miss. Keep the cache key as narrow as the content actually requires.
See also: s3 and alb origin patterns · cache keys ttl and invalidation

