Im new to PHP myself and had a the same question on another forum. I was told that PEAR had a caching system that works, but im not at that level yet and still looking into it. Here is what what i got for a response.
"There are several solutions, from kludgy ones like the one I made for some template engines (www.castagnetto.org/CachedTemplate_page.php), to more sophisticated ones based in PEAR Cache (cvs.php.net/cvs.php/pear/Cache, or http://pear.php.net/package-info.php?pacid=40), which can do caching on the filesystem, other DBs, LDAP, etc. at the script, function, class, or method levels."