Here's the deal, I have a dynamic website that I want to convert to static. The website is database/php driven, I want to create a "snapshot" of the website at a given time and have that "snapshot" replace the website.
If your goal is to reduce server load, just cache yoru php output. As you create your page with php, just keep adding it to a variable instead of echoing it. at the end of the page, you output it, and save it to a cache file, which will be checked before re-generating it. Pseudo code: <?php $me = $SERVER['PHP_SELF']; $me = str_replace( '/', '_', $me ); if( file_exists( $my_cache_dir.'/'.$me.'.txt' ) ){ echo file_get_contents( $my_cache_dir.'/'.$me.'.txt' ); }else{ // Create my whole page here and save it in a variable $output = ''; $output .= 'Hello world.'; ... echo $output; $f = fopen( $my_cache_dir.'/'.$me.'.txt', 'w' ); fputs( $f, $output ); fclose( $f ); } ?> PHP: And whenever you need to re-generate the pages, just clear out $my_cache_dir
My goal is to create a dynamic website on my local computer, Grab a Snapshot and upload that snapshot.
You probably want some sort of spidering program. Which OS are you using? Your options will vary depending on that.
For linux: Wget can recurse through your site, and convert files to static HTML. Type "man wget" in linux for the manual page. Wget is included with pretty much every linux distro. For Windows: I'll edit this post with Windows suggestions if I can think of any.
Thanks a lot, *hits head*, I forgot linux comes with everything but the kitchensink, time to remove the dust from the knoppix cd. also wget ( and other gnu stuff) for windows http://unxutils.sourceforge.net/