private function storeResponse(string
$cacheKey, ResponseCacheConfiguration
$cacheConfig, Response
$symfonyResponse): void
{ $item =
$this->cache->
getItem($cacheKey);
// add the header only for the response in cache and remove the header before the response is sent
$symfonyResponse->headers->
set(self::INVALIDATION_STATES_HEADER,
implode(',',
$cacheConfig->
getInvalidationStates()));
$item = CacheCompressor::
compress($item,
$symfonyResponse);
$symfonyResponse->headers->
remove(self::INVALIDATION_STATES_HEADER
);
$item->
tag($cacheConfig->
getCacheTags());
$item->
expiresAfter($cacheConfig->
getMaxAge());
$this->cache->
save($item);
}}