Skip to content

Commit 5834340

Browse files
committed
bug #5673 Update http_cache.rst (szyszka90)
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
2 parents d64e993 + aa1750b commit 5834340

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

book/http_cache.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ header value::
651651
namespace AppBundle\Controller;
652652

653653
// ...
654+
use Symfony\Component\HttpFoundation\Response;
654655
use Symfony\Component\HttpFoundation\Request;
655656
use AppBundle\Entity\Article;
656657

@@ -665,6 +666,7 @@ header value::
665666

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

669+
$response = new Response();
668670
$response->setLastModified($date);
669671
// Set response as public. Otherwise it will be private by default.
670672
$response->setPublic();

0 commit comments

Comments
 (0)