This is for those really heavy traffic cabaltoolz sites.
This will speed up your site up to 10x faster. ( boosting may vary from case to case )
Minimal Installations.
1. Create a new folder in your frontend. called "tmp" ( no qoutes )
2. Replace your index.php with this.
PHP Code:<?PHP
include('config.php');
$cachetime = 5 * 60; // cache time
error_reporting(1);
if (isset($_GET['page'])) {
$urli = explode('-',$_GET['page']); settype($argv,'array');
}
$cachefile = 'tmp/'.$_config['template'].'-'.$urli[0].'-'.$urli[1].'.html';
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) {
include($cachefile);
echo "<!-- Cached copy, generated ".date('H:i', filemtime($cachefile))." -->\n";
exit;
}
ob_start("ob_gzhandler");
session_start();
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
if ($_config['close_site'] == true ) header('Location: '.$_config['redirect']);
foreach($urli as $url => $i) $tags .= ucwords($i). ', ';
foreach($urli as $url => $i) $title .= ucwords($i). ' | ';
$urli_desc = array(
'hero' => 'Viewing '.$urli[0].' '.$_config['server_name'].' Profile '.$urli[2].' with Unique ID: '.$urli[1],
'guilds' => 'Viewing '.$urli[2].' Guild Page '.$_config['server_name'].' with Unique ID: '.$urli[1],
);
if ($urli_desc[$urli[0]]) $urli_desc = $_config['server_name'] .' '. $urli_desc[$urli[0]];
else $urli_desc = 'Hottest New Server Website for '.$_config['server_name'].' . A Free to Play server';
//template catch ( feel free to delete if u dont have templates. ^^ )
if (@$urli[0] == 'template') {
if (file_exists('template/'.$urli[1].'/index.php')) {
setcookie('template',$urli[1],time() + (86400 * 7));
$_config['template'] = $_COOKIE['template'];
header('LOCATION: index.html');
}
}
if (@$_COOKIE['template']) {
if (file_exists('template/'.$_COOKIE['template'].'/index.php')) {
$_config['template'] = $_COOKIE['template'];
}
}
//end template catch
$fullurl = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], "/")+1);
include_once('template/'.$_config['template'].'/index.php');
$fp = fopen($cachefile, 'w');
fwrite($fp, ob_get_contents());
fclose($fp);
ob_end_flush();
?>


Reply With Quote



