/**
* Build the response so that depending on settings it's cacheable
*
* @param string|null $etag
* @param \DateTime|null $lastModified
*
* @return \Symfony\Component\HttpFoundation\Response
* @see \eZ\Publish\Core\MVC\Symfony\Controller\Content\ViewController::buildResponse
*/
protected function buildResponse($etag = null, DateTime $lastModified = null)
{
if ('POST' === $this->getRequest()->getMethod()) {
$response = new Response();
$response->setPrivate();
return $response;
} else {
return parent::buildResponse($etag, $lastModified);
}
}