Updates the Response HTTP headers based on the embedded Responses.
Response $response:
Overrides EsiResponseCacheStrategyInterface::update
public function update(Response $response) {
// if we only have one Response, do nothing
if (1 === count($this->ttls)) {
return;
}
if (!$this->cacheable) {
$response->headers
->set('Cache-Control', 'no-cache, must-revalidate');
return;
}
if (null !== ($maxAge = min($this->maxAges))) {
$response
->setSharedMaxAge($maxAge);
$response->headers
->set('Age', $maxAge - min($this->ttls));
}
$response
->setMaxAge(0);
}