Over the past month or so I have been toying with the idea of developing a way to cache dynamic PHP pages with out a lot of overhead. I stumbled across this blog entry: http://papermashup.com/caching-dynamic-php-pages-easily the idea was so simple it was almost too easy. So I took it upon my self to turn the original code and some of the user comments code into a class. I have made some minor changes(cleaned up if statements, fixed a bug dealing with the cached version of the page not getting served out when it hadn't expired yet) to the code but for the most part its mostly the same.
implementation
<?php require_once "page_cache.class.php"; $cache=new page_cache(120); //cache page for 2 hours //put //page //content //here $cache->createCachedPage(); ?>