note 34434 added to function.header
| From: | aemege | Date: | Sun, 27 Jul 2003 02:42:14 +0000 |
| Subject: | note 34434 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52732@lists.php.net to get a copy of this message | ||
Eliminemos el Cache
I was using for NO CACHE the pages this
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, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
But it doesn´t WORK, so I read in a post that using the function time() it will work for NO CACHE
the pages, you must to all yours links inclusive using header(Location: something like this
echo "<a href='url.php?".time()."&var1=some&var2=some2'>
-------------------------------------------------------
En español ahora, aqui se van a entender más fácil espero
Intente de muchas maneras que el browser no almacenara las pagina en el cache, y funcionaba a medias
es decir a veces igual las cargaba del cache, leyendo en alguna parte vi que agregando a la url el
tiempo obtenido de la funcion time() la iba a actualizar a cada rato, ya que creo que se debe a que
es un parametro nuevo cada vez, así que agregando time, nos ahorramos los header, y si funciona,
quedando algo como:
echo "<a
href='la_url.php?'".time()."&variable=1515&otra=rer>"
Lo anterior incluso funciona con Location del header osea algo asi:
header("Location: http://$SERVER_NAME/algo.php?".time()."");
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34434
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34434&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34434&report=yes