Skip to content

Instantly share code, notes, and snippets.

@Gregoire-M
Created August 29, 2012 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Gregoire-M/3508003 to your computer and use it in GitHub Desktop.
Save Gregoire-M/3508003 to your computer and use it in GitHub Desktop.
ESI issue
public function displayAction(Post $post)
{
// page caching
$response = new Response();
$response->setLastModified($post->getModificationDate());
$response->setPublic();
if ($response->isNotModified($this->getRequest())) {
return $response;
}
// ...
return $this->render('GregoireMBlogBundle:Blog:display.html.twig', array(
'post' => $post,
'uid' => rand(0, 10000),
), $response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment