Skip to content

Commit

Permalink
Update http_cache.rst
Browse files Browse the repository at this point in the history
Forgotten new Response instance in example from Optimizing your Code with Validation section.
  • Loading branch information
szyszka90 committed Sep 3, 2015
1 parent 0340e1f commit 1624197
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ header value::
namespace AppBundle\Controller;

// ...
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Entity\Article;

Expand All @@ -665,6 +666,7 @@ header value::

$date = $authorDate > $articleDate ? $authorDate : $articleDate;

$response = new Response();
$response->setLastModified($date);
// Set response as public. Otherwise it will be private by default.
$response->setPublic();
Expand Down

0 comments on commit 1624197

Please sign in to comment.