I have a Controller whose Action is rendered in twig with
{{ render_esi(controller('MyWebsiteBundle:Element:header')) }}
The Action itself looks like this:
/**
* @return Response
*/
public function headerAction()
{
$currentLocale = $this->getCurrentLocale();
$response = $this->render('MyWebsiteBundle:Element:header.html.twig', array(
'currentLocale' => $currentLocale,
'myTime' => time()
));
$response->setPublic();
$response->setSharedMaxAge(3600);
return $response;
}
When I reload my Browser, the "myTime"
changes everytime.
How can I use setShardeMaxAge()
, so that the Twig is only renderd after the MaxAge is expired?