How to add cache contexts to a region
You can add a cache context to a region the same way as to any other page element:

function mytheme_preprocess_region(&amp;$variables) {
  if ($variables['region'] == 'myregion') {
    $variables['#cache']['contexts'][] = 'user';
  }
}


But this is probably not what you want, because regions are not cached. Usually the blocks inside a region are cached and the complete page which contains the regions. The cache context of the region will only have an effect on higher level elements, not downwards.