Page Caching, MVCC, Postgresql

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I had a problem today where I had an editor page (edit2.php) that
posted data to PostgreSQL, and then a view page (view.php) that read
it in and displayed it. At first I thought this was an MVCC issue in
PostgreSQL because it was not displaying the latest changes, but the
second-to-latest changes. The end user was using IE 5, so he saw the
problem, but I was using Mozilla in RH9 Linux, so I never saw the
problem. Turns out it had nothing to do with MVCC feature in

I resolved the problem by adding this in my banner.php that loads with
a require() at the top of my HTML in order to display a banner on each

if ($nocache_page) {
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

and on pages where I needed to ensure no cache was used, I implemented
this feature by simply putting

$nocache_page = TRUE;

in it before banner.php was called.

By using the condition check, it permits me to have some pages to
cache and other pages to not.

Site Timeline