mirror of
https://gitnet.fr/deblan/gist.git
synced 2021-08-14 08:30:49 +02:00
New HTTP Cache headers and cache disabled for account page
This commit is contained in:
parent
f36783b2ce
commit
fbac488f62
@ -196,9 +196,13 @@ abstract class Controller
|
||||
|
||||
if (empty($params['no_cache'])) {
|
||||
$ttl = 3600 * 24 * 7;
|
||||
$etag = sha1($response->getContent());
|
||||
|
||||
$response->setTtl($ttl);
|
||||
$response->setClientTtl($ttl);
|
||||
$response->setExpires(new \DateTime('now +7 days'));
|
||||
$response->setLastModified(new \DateTime('now'));
|
||||
$response->setEtag($etag, true);
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
@ -130,6 +130,7 @@ class MyController extends Controller
|
||||
'filterForm' => $filterForm->createView(),
|
||||
'passwordForm' => $passwordForm->createView(),
|
||||
'deleted' => !empty($deleted),
|
||||
'no_cache' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user