Page Caching, MVCC, Postgresql

From: Google Mike (googlemike_at_hotpop.com)
Date: 07/30/04


Date: 30 Jul 2004 08:15:42 -0700

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
PostgreSQL.

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
page.

if ($nocache_page) {
  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");
}

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.



Relevant Pages

  • Re: Tuning for PostGreSQL Database
    ... > memory area. ... It is wasteful for the DBMS and the OS to both cache this ... You'll want the PostgreSQL shared memory size to be around 75% the ... > size of RAM. ...
    (freebsd-performance)
  • Re: Purchasing the correct hardware: dual-core intel? Big cache?
    ... Depending on where you got the PostgreSQL, was it in binary form or source. ... While a bigger cache may help, as may dual core CPU's, or faster CPU's. ... Poor optimization causes a CPU to chug along, ... MailScanner thanks transtec Computers for their support. ...
    (freebsd-questions)
  • Re: Tuning for PostGreSQL Database
    ... Anything that PostGreSQL reads should wind up in the cache? ... It is wasteful for the DBMS and the OS to both cache this ... You'll want the PostgreSQL shared memory size to be around 75% the ...
    (freebsd-performance)
  • Re: Purchasing the correct hardware: dual-core intel? Big cache?
    ... Poor optimization causes a CPU to chug along, flushing the CPU cache ... The database server is PostgreSQL. ...
    (freebsd-questions)