Skip to content

Commit

Permalink
bug #5673 Update http_cache.rst (szyszka90)
Browse files Browse the repository at this point in the history
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #5673).

Discussion
----------

Update http_cache.rst

Forgotten new Response instance in example from ```Validation with the Last-Modified Header``` section.

Commits
-------

aa1750b Update http_cache.rst
  • Loading branch information
wouterj committed Sep 5, 2015
2 parents d64e993 + aa1750b commit 5834340
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 5834340

Please sign in to comment.