Is it possible to make the Cloudflare CDN use different cache entries based on a cookie value?
More specifically, can I put a cookie that has
theme=light
and get a different cached response from the CDN than if I have theme=dark
?3 Replies
You need a Custom Cache Key, which is only available on the Enterprise plan https://developers.cloudflare.com/cache/how-to/cache-keys/
Cloudflare Docs
Cache Keys · Cloudflare Cache (CDN) docs
A Cache Key is an identifier that Cloudflare uses for a file in our cache, and the Cache Key Template defines the identifier for a given HTTP request. …
Thanks!
you should do theming client side
then you can get the benefit of caching and not pay the pricey plan