As nice as PHP caching is, it is still slow, and who wants to spend time implementing it?

Fortunately, both Zend and MMcache developers have realized this need and developed a content caching mechanism into their PHP acceleration packages.

MMCache Content Cache
<?php
    mmcache_cache_page(__FILE__, 600); // MMcache cache

    // Simple guestbook script.
    $db = new sqlite_db("gb.sqlite");
    $r = $db->array_query("SELECT * FROM guestbook", SQLITE_ASSOC);
    foreach ($r as $row) {
        echo $r->user . ' wrote on ' . date("Ymd", $r->date) . ":<br />\n";
        echo $r->message . "<hr /><hr />";
    }
?>