page cache disable php code

by Prakash 2013-08-03 14:42:12

Use the following code on the top of the php page to disable page caching by browser :

//no cache code
header( 'Expires: Sat, 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' );


Remember that you have to send this header before sending anyother HTML to the browser.
534
like
0
dislike
0
mail
flag

You must LOGIN to add comments