Symfony2's answer - Clear cache headers on the back button

I have a problem clearing the cache when I click the back button.

My header info says I'm loaded from cache:

Status Code:200 OK (from cache) 

My answer is set to:

 $response = new Response; $response->expire(); $response->headers->addCacheControlDirective('must-revalidate', true); $response->headers->addCacheControlDirective('allow_reload', true); 

What am I doing wrong? None of the documentation methods work ...

+6
source share
1 answer

Taking the advice from this article , and the Cache-Control directives I set up worked for me - by pressing the button of a button a 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); 
+9
source

All Articles