ExitCaching: content-delivery cache policies1 / 9
Explanation

A cache key defines which requests can share a response

How cache policies control safe response reuse and origin traffic through content-varying cache keys, TTL bounds, and cache bypass. · advanced

A CloudFront cache key identifies the cached response a request can reuse. Selecting request attributes for that key is a correctness decision before it is a performance decision: requests that need different content must not share an indistinguishable cached response. Adding attributes that do not change content instead creates unnecessary entries, reducing opportunities for reuse and increasing origin traffic.

For query strings, a cache policy offers four selections: none, all, specified parameters, or all except specified parameters. Selected parameters enter the cache key and are automatically included in origin requests. Excluded parameters do neither automatically through that cache policy. Choose parameters for which the origin returns distinct content, rather than including every parameter simply because it exists.

For example, if language changes the response but campaign only records attribution, key on language, not campaign. Values also matter: language=EN and language=en can cause separate origin requests and separate cache entries even if the origin returns identical content. CloudFront does not infer that those values are equivalent.