Cache context drupal don't work I changed services.yml file (i use dynamic cache):

renderer.config:
required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions', 'cookies:Drupal.visitor.Country']


And sey the cookie properly with an event:

$events[KernelEvents::REQUEST][] = ['checkCountry', 30];
...
 user_cookie_save(['Country' =&gt; $country]);


I checked and the cookie is saved correctly.
But the cache does not work...
Anonymous page cache does not respect cache contexts, I'm guessing that is your problem.

To get that working, you need to switch out the PageCache service in a custom module with a ServiceProvider and override the getCacheId() method.