How to prevent caching from web browser?
hello, i need to refresh the web page everytime the user has reenter the existing URL or clicking on back button...one way to solve this problem is prevent caching from web browser, right.
i had tried the meta type method but this method seem like not very effective for IE.
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
then, i tried to use php method to disable the caching feature but come out an error like this:
Warning: Cannot modify header information - headers already sent by (output started at /home/james/public_html/investment/investment.php:1) in /home/james/public_html/investment/investment.php on line 1
Warning: Cannot modify header information - headers already sent by (output started at /home/james/public_html/investment/investment.php:1) in /home/james/public_html/investment/investment.php on line 1
Warning: Cannot modify header information - headers already sent by (output started at /home/james/public_html/investment/investment.php:1) in /home/james/public_html/investment/investment.php on line 1
Warning: Cannot modify header information - headers already sent by (output started at /home/james/public_html/investment/investment.php:1) in /home/james/public_html/investment/investment.php on line 1
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
does anyone know what i had done wrong?
|