Page 1 of 1

header()

Posted: Wed Aug 02, 2006 3:11 pm
by yamobe
Hi, can someone explain as I was a five years old boy step by step what this is?

Code: Select all

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");

my code is:

Code: Select all

<?php
	header("Cache-Control: no-store, no-cache, must-revalidate");
	header("Pragma: no-cache");
    $mifichero = "C:\posicion.txt";
    $posicion=array();
    $referencia=array();
    if ($mi_array=file($mifichero)) {
        list ($linea, $contenido) = each ($mi_array);
    }
    echo $contenido;
?>
And I get a 5 seconds delay in the value of $contenido, no matter if I am on the server or in another country... And I am calling this function every second

thanks for the help

Posted: Wed Aug 02, 2006 3:18 pm
by RobertGonzalez
Those two lines are telling the browser to not store static cached copies of the pages content on the client machine and every time the page loads, to load from the server instead of the local cache copy, I believe.

Posted: Wed Aug 02, 2006 3:33 pm
by yamobe
Everah wrote:Those two lines are telling the browser to not store static cached copies of the pages content on the client machine and every time the page loads, to load from the server instead of the local cache copy, I believe.
thanks, that's exactly what I needed to know :D

Posted: Wed Aug 02, 2006 5:35 pm
by Ollie Saunders
Everah wrote:Those two lines are telling the browser to not store static cached copies of the pages content on the client machine and every time the page loads, to load from the server instead of the local cache copy, I believe.
Whether they actually work or not is a matter of debate.

Posted: Thu Aug 03, 2006 2:15 am
by julian_lp
ole wrote:
Everah wrote:Those two lines are telling the browser to not store static cached copies of the pages content on the client machine and every time the page loads, to load from the server instead of the local cache copy, I believe.
Whether they actually work or not is a matter of debate.

I guess you could try changing images' content (not changing their file names), and load the page again to see what happens...