Cache key
The exact identity a cached response is stored under. Same key, same copy served, which is great until two pages collide.
See it
What it is
The exact string a cache files a response under. Two requests that compute the same key get the same stored copy. By default the key is roughly method plus host plus path (often plus the query string), extended by whatever the Vary header names: encoding, language, sometimes a device hint.
You tune it from both ends. Strip parts that do not change the response, like 'utm_source', 'fbclid', and 'gclid', so one shared link does not spawn a thousand separate entries. Add parts that do change it, like a country header or a currency cookie, so Germany and the US get different copies instead of fighting over one.
Both mistakes hurt, but only one is scary. A key that is too fine means a collapsed hit ratio and a busy origin. A key that is too coarse means a personalized page cached without the session in the key, and now every visitor is looking at one unlucky user's dashboard. Anything user-specific should be marked private and never enter a shared cache at all.
Ask AI for it
Define an explicit CDN cache key for these routes: include scheme, host, and path, keep only the query params that actually change the response ('page', 'sort', 'q'), and strip 'utm_*', 'fbclid', 'gclid', and 'ref'. Vary on Accept-Encoding and Accept-Language, add the country header to the key for the localized routes, and mark every route that reads a session cookie as 'Cache-Control: private, no-store' so it never lands in the shared cache. Show me the config and the resulting response headers.