Le 10/05/2011 18:20, hub74 a écrit :
Hello,
My Symfony's proxy cache is enabled (with default options).
My action:
Code: Select all
public function indexAction()
{
$content = $this-
renderView('AcmeDemoBundle:Essai:index.html.twig');
$response = new Response($content);
$response->setSharedMaxAge(3600);
return $response;
}
The cache works but this is the header received by the browser:
Cache-Control: max-age=0, public, s-maxage=3600
So, if a second proxy receive this header (eg: proxy of a company), I
can't purge this second proxy.
How to solve this problem?
If you need to purge the cache, it means that you put wrong headers in
your response. As stated in the doc, a good caching strategy should
never imply invalidation:
http://symfony.com/doc/2.0/book/http_cache.html#cache-invalidation
Second question:
My action:
Code: Select all
public function indexAction()
{
$content = $this-
renderView('AcmeDemoBundle:Essai:index.html.twig');
$response = new Response($content);
$response->setMaxAge(60);
$response->setPrivate();
return $response;
}
Why the header received by the browser like this?
Cache-Control: max-age=0, public, s-maxage=6
This is weird. Are you sure that you are not getting a response
previously cached ?
--
Christophe | Stof
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en