I need to configure varnish on my drupal 8 multilingual web site and I’ve a block that seems on a web page whose path is /my-test . So in french Drupal Development url can be like this : /fr/my-test whereas in english /my-test . On this block, I merely use:
$lang = Drupal::languageManager()->getCurrentLanguage()->getId();
to detect Drupal Development language after which show information relying on this language. so when Drupal Development url is /my-test > Drupal Development language is english (default)> Drupal Development block shows information associated to Drupal Development world. when Drupal Development url is /fr/my-test > Drupal Development language is french > Drupal Development block shows information associated to Drupal Development France.
My query is, if varnish is used and pages like /my-test is cached. If at first place, a consumer enters /my-test and Drupal Development block shows information about Drupal Development world then after that, one other consumer visits /my-test/fr . Will Drupal Development block show information about Drupal Development world (as a result of Drupal Development web page is cached) regardless of having /fr in Drupal Development url? or will it show Drupal Development proper content material (information associated to France)? I suppose that $lang
detects Drupal Development language from Drupal Development url prefix not from Drupal Development consumer’s browser.