[PHP-DB] Re: Web Page Caching

2003-02-16 Thread Fredrik de Vibe
[EMAIL PROTECTED] (Philip Zee) writes:
 I don't know if this is the right list to send this question to. It
 appears that the browser caches the result after a PHP page updates
 the database. I have to manually reload it in order to see the
 updates. Does anyone know how to overcome this?

If you put these before any output from your script, that might help.

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

Read about cache control on e.g. http://vancouver-webpages.com/META/
and also check out http://www.php.net/manual/en/function.header.php


-- 
--Fredrik
Why be a man when you can be a success?
-- Bertold Brecht

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Web Page Caching

2003-02-16 Thread Adam Royle
This may not be true in your case, but I remember another user on this list claiming a 
similar thing, and his problem was actually code-related. He had his db update code 
*AFTER* the results were displayed (ie. doing edit and save on same page).

Check your programming logic. Just a note to people out there who may not have much 
programming experience - try doing all of your server-side processing (or at least db 
and filesystem calls, etc) before you output any data, this way you can implement 
error checking etc and still use the header() function, etc. 

Adam


--- Original Message ---

Hello,

I don't know if this is the right list to send this question to.  It appears that the 
browser caches the result after a PHP page updates the database.  I have to manually 
reload it in order to see the updates.  Does anyone know how to overcome this?

Thanks,

Philip