I need to invalidate the Internal Page Cache for anonymous users when the value of a specific cookie changes. How can I implement this?
I'm tried to add:
$build['#cache']['contexts'][] = 'cookies:my-cookie-name'
in hook_entity_build_defaults_alter
, but that doesn't help.
And the page still returns from the cache.