Browse Source

New HTTP Cache headers and cache disabled for account page

dev-master
Simon Vieille 2 years ago
parent
commit
fbac488f62
2 changed files with 5 additions and 0 deletions
  1. +4
    -0
      src/Gist/Controller/Controller.php
  2. +1
    -0
      src/Gist/Controller/MyController.php

+ 4
- 0
src/Gist/Controller/Controller.php 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;


+ 1
- 0
src/Gist/Controller/MyController.php View File

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


Loading…
Cancel
Save