View Single Post
Old 11-11-2008, 04:52 PM  
Tjeezers
Webmaster
 
Tjeezers's Avatar
 
Industry Role:
Join Date: Mar 2007
Location: BP4L - NL/RO
Posts: 16,556
Step 3 ...

Code:
<?
// CALL THE CACHING CLASS

require_once("cache.php");

// SET THE CACHING FOLDER PATH

$path = "./cache";
$self = $_SERVER['PHP_SELF'];
$query = !empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null;
$file = md5('index');

// SET THE EXPIRATION TIME (IN SECONDS)

$expire = 3600;
$cache = new Cache($path);

// START WRITING TO CACHE

while($cache->save($file,$expire))

{

?>

You place this CODE in your index.php

variable is $expire = 3600;
Higher number, good for high traffic volume
Lower Number, good for low traffic volume

NOW step 4

You place below code above the footer include.

Code:
<?

// FINISH WRITING TO CACHE

}

?>
This should do the trick

You can see the end result on www.SmutThumb.com, as you can see there, the index refreshes every 60 minutes. So the load is way more friendly.
This code is costume. It is made to solve the problem you run into now.

Kind Regards

Harry
__________________
Enroll in the SWAG Affiliate Asian Live Cam Program and get 9 free quality linkbacks from my network!
Wanna see how old school I am? Look at this! All my Cam Review Sites are here!
Tjeezers is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote