Drupal Page Cache does not currently respect the Vary header , please see the following issues on Drupal.org for more information:
- Page Cache must respect Vary, otherwise it might serve mismatched responses.
- Introduce "Vary" page cache response policy
Any Drupal application with page cache enabled attempting to use the Vary header for variations in cache.
As a current workaround you can disable page cache by adding the following snippet in
$settings['cache']['bins']['page'] = 'cache.backend.null';