In my ajax response the Cache-Control Header is displayed in the markup.
HTTP/1.0 200 OK Cache-Control: no-cache Date: Thu, 11 Oct 2012 09:00:59 GMT
The method render()
display headers.
You can use method renderView()
. This method don't display headers, just the generate html.
Hope it's helpful. :)
You can either do
$template = $this->render('list.html.twig', array());
return new Response($template->getContent());
Or do this
$template = $this->renderView('list.html.twig', array());
return new Response($template);
Second is more appropriate.