Skip to content

Commit aa1750b

Browse files
szyszka90wouterj
authored andcommitted
Update http_cache.rst
Forgotten new Response instance in example from Validation with the Last-Modified Header section.
1 parent d64e993 commit aa1750b

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)