Symfony2 response - Clear cache headers on back button Symfony2 response - Clear cache headers on back button symfony symfony

Symfony2 response - Clear cache headers on back button


Taking advice from this article and setting listed Cache-Control directives worked for me - by pressing back button request to the server was always sent.

$response->headers->addCacheControlDirective('no-cache', true);$response->headers->addCacheControlDirective('max-age', 0);$response->headers->addCacheControlDirective('must-revalidate', true);$response->headers->addCacheControlDirective('no-store', true);