Why Cookies Break Caching
- Alon Kochba
- Aug 20
- 1 min read
Cookies often signal that a response is personalized—think logged-in state, location, or A/B test buckets. If a CDN cached one user’s personalized page and served it to others, it would be a privacy and correctness problem.
To avoid that, many CDNs treat requests with certain cookies as uncacheable, or they vary the cache key by cookie values. Both approaches reduce cache hit rates because the content becomes fragmented into many versions.
A common fix is to keep truly personalized data out of the cached HTML (load it via an API call), and to strip or ignore non-essential cookies at the edge so shared assets can still be cached effectively.
Comments