Cache key with value extracted from cookie

my website use a cookie to store the preferred language of a user.
I would like that cache-keys for this website takes into account this language.
How can I do this ? Extract the language from the cookie (the cookie value is a json) and tell cloudflare to use it to build its cache-key.
Best regards

I will keep the cookie value simple instead of the JSON value. Remember if you have this in the cache key it can be many variations of the cache/cache key, how many users how many languages?

only 3 languages so there should be not much variation.
My framework is built around this kind of json cookie, so it is important for me to extract juste the key “locale” from the cookie

I will recommend dropping a new cookie something userlang=en and creating cache key based on the new cookie.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.