PHP caching problem when host under Linux
Posted: Mon Jun 21, 2004 12:01 am
Hi all,
I am doing a shopping cart for music site. My problem is when i add an item to the shopping cart it displays properly. If i add another item to the cart it won't display unless i press Ctrl + Refresh(F5) key combination. Same thing happen if i delete item from the cart. Even though it gets deleted from the database, when i click show cart button it will display the deleted item also. Within the PHP i clear the cache using following code.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
but this works fine on my localhost which on windows. When i run this on Linux it wouldn't work.
I am sure this is a cache problem but not on the browser may be on the server or session cache. Why i am saying so same browse would work fine when the programs host on windows. I use apache 2.0.48 / PHP 4.3.1 and Mysql 3.23.
Any suggestions ???
I am doing a shopping cart for music site. My problem is when i add an item to the shopping cart it displays properly. If i add another item to the cart it won't display unless i press Ctrl + Refresh(F5) key combination. Same thing happen if i delete item from the cart. Even though it gets deleted from the database, when i click show cart button it will display the deleted item also. Within the PHP i clear the cache using following code.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
but this works fine on my localhost which on windows. When i run this on Linux it wouldn't work.
I am sure this is a cache problem but not on the browser may be on the server or session cache. Why i am saying so same browse would work fine when the programs host on windows. I use apache 2.0.48 / PHP 4.3.1 and Mysql 3.23.
Any suggestions ???