Add Vary header in case of content negotiation

Sometimes we return different content depending on whether JSON, XML or
HTML was requested in the Accept request header. The Vary response
header should list that header in these cases, to allow caching
frameworks to determine what to cache.
This commit is contained in:
Gidi Kroon 2023-06-25 03:22:41 +02:00
parent ff1409e626
commit 6a5266c6b8
5 changed files with 13 additions and 1 deletions

View file

@ -162,6 +162,8 @@ class Display extends BaseModule
$output .= $this->getDisplayData($item);
header('Vary: Accept', false);
return $output;
}