CloudFront serves public images identical for all users. At the same path, origin images differ for v=1 and v=2; tracking parameters such as utm_source do not change content. Cookies and other headers do not select different versions.
Return the correct v while reducing needless fragmentation by tracking values. Cacheable responses and TTLs are prepared; private and authorization-dependent content are excluded.
How should query settings be configured for the applicable cache behavior?
Keep content-changing v in the key and exclude tracking queries, preserving correct versions and reuse.
Detailed explanation
Because v changes the response, excluding it can mix representations. Preserve correct response separation rather than optimizing only hit rate.
Forwarding alone does not separate cache entries. A cache hit can avoid origin and return a cached response for another v.
Separate versions by the content-changing v value without splitting on irrelevant tracking values. Values in the cache key are automatically included in origin requests.
This preserves versions but unnecessarily fragments identical content by tracking values, failing the stated efficiency requirement.
Check official documentation
Compare the following points with the official documentation.
Inspect the approved test distribution behavior, cache policy, origin request policy, and TTL. At the same path and headers, compare requests changing only tracking values with requests changing v. Inspect content, X-Cache, and origin logs.
Official references
- Official documentation 1
- Official documentation 2
- Official documentation 3
- Official documentation 4
- Official documentation 5
What to confirm
Tracking changes with the same v use one key; different v values use distinct keys and return the correct images. Account for TTL, POP, and cache state when interpreting Hit/Miss; forwarding configuration alone does not separate cache entries.
Key points
- CloudFront cache policy
- Origin request policy
- Cache key
Notes
- Environment: Official CloudFront documentation and an approved public-image test distribution and observable origin
- Reviewed against the linked AWS documentation on 2026-10-15.
Foundation review
Retain content-changing values
Selecting query name v in cache policy includes its value in the key. Exclude tracking parameters only because they do not change content here. Do not remove all response-varying attributes indiscriminately.
Separate forwarding from cache partitioning
A cache-key value such as v is automatically sent to origin. Origin request policy can forward extra data without changing the key, but including v only there does not create separate cached representations.
Verify behavior and actual cache state
Check the policy on the behavior matching the request path and compare content, X-Cache, and origin logs under consistent conditions. TTL expiry, different POPs, and cache state can produce Miss even for the same key. Do not generalize this public-static scenario to user-specific or authenticated content.