New HTTP Cache headers and cache disabled for account page

This commit is contained in:
Simon Vieille 2018-08-21 16:10:20 +02:00
parent f36783b2ce
commit fbac488f62
2 changed files with 5 additions and 0 deletions

View file

@ -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;

View file

@ -130,6 +130,7 @@ class MyController extends Controller
'filterForm' => $filterForm->createView(),
'passwordForm' => $passwordForm->createView(),
'deleted' => !empty($deleted),
'no_cache' => true,
)
);
}