php - Manipulate response via controller to force no cache -


i have zf2 php app , want page never put in cache , force browser new 1 each time.

first : how manipulate response through controller (zf 2.4) ? search fall on older version, 1.x , one. maybe miss thing.

second : have advice 'browser never cache' manipulation ? on php.net lot of solution in pure php, maybe know way zf2.

thanks, have nice day

you can access headers through response object follows controller action:

$this->getresponse()->getheaders()->addheaderline('cache-control: no-store, no-cache, must-revalidate, max-age=0') 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -