Cache system

Xagone

so many ppl tried to hack my cache, so funny!
Xagone Inc. (formerly VotreEspace)
[url="http://xagone.com/"]http://xagone.com/[/url]

Xagone

I've done a little cache system for my website in the template index.php, it work in a way that it takes ~25% less time for my server to send the html...
but i'd like a true cache system on WSB.

here's what i've done :
in my index.php
at the absolute beginining of the file (before ANYTHING)
<?php
// Include the WB functions file
require_once(WB_PATH.'/framework/functions.php');
if(
file_exists(WB_PATH.'/temp/'.page_filename($_SERVER['REQUEST_URI']).'.tmp') &&
filemtime(WB_PATH.'/temp/'.page_filename($_SERVER['REQUEST_URI']).'.tmp') >= (time()-86400)) {
#header('HTTP/1.1 304 Not Modified');
exit(file_get_contents(WB_PATH.'/temp/'.page_filename($_SERVER['REQUEST_URI']).'.tmp'));
} else {
ob_start('cache_temp');
?>

and not at the absolute end :
<?php 
ob_end_flush
();
}
function 
cache_temp($buffer) {
file_put_contents(WB_PATH.'/temp/'.page_filename($_SERVER['REQUEST_URI']).'.tmp',$buffer);
return $buffer;
}
?>


it's a 24h cache, cause my site dont change that much, but you can play with it by changing the "86400" to something else like :
6 hours = 21600
1 hour = 3600
10 min : 600
Xagone Inc. (formerly VotreEspace)
[url="http://xagone.com/"]http://xagone.com/[/url]