I have an API which returns various json, like terms of a vocab, nodes of a type, with specific fields and so on.
Now, in my API I am getting the requested language like so:
$request = \Drupal::request(); $lang = $request->query->get('lang', 'en');
And load the respective translations of the entities.
Now, how can I add that
$lang parameter as a cache indicator? So that:
creates another cache than:
Also, is that the right way to deliver language specific content in an API?