View Full Version : Cache problem

10-12-2004, 01:29 PM
Previously the server was standalone and i was able to disable the cache and handle in PHP code... Now when i put the server behind LoadBalancer, all the site pages get cached.. like, say

when i click edit profile from member page and after editing and submit, i show a success page and redirect back to member page and again if i click it will show the edit page.. it was working fine when the server was out of LoadBalancer. But when i put inside LB, then after first time of editing whenever i click the edit profile the page directly goes to success page and redirects to Member page without showing the edit page...

How can i fix this ?


10-14-2004, 08:29 AM
maybe send the headers for no cache?
try putting this at the top of your code

header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');

and so I googled a bit and someone posted this article..

let us know how it goes.

and found this post that was made:

Subject: 3 lines will handle IE 5.x, Netscape 4.x, etc

header("Cache-Control: private");
header("Cache-Control: no-cache");
header("Pragma: no-cache");

That's it.