Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Making Nuke Efficient
Author Message
Bigboy177
Worker
Worker



Joined: Jul 07, 2004
Posts: 192

PostPosted: Sat Sep 24, 2005 6:10 am Reply with quote

First you have to ofcourse have the cache lite installed, and the pear library... Cache Lite can be found here:

http://pear.php.net/package-info.php?pacid=99

the pear library here:

http://pear.php.net/package/PEAR

Install both...

And then...

For Example if I want to cache the list of reviews...

At the begining of the place you want to cache put:

Code:


require_once("includes/Cache_Lite/Lite.php");

$options = array(
  "cacheDir" => "/home/mydirname/tmp/Reviews_list",
  "lifeTime" => 900
);
$objCache = new Cache_Lite($options);

if ($rev_l = $objCache->get("Reviews_list")) {
echo "$rev_l";
}
else
{

ob_start();


Here goes the content you want to cache...
And at the end of the cached content put:

Code:


$rev_l = ob_get_contents();
$objCache->save($rev_l, "Reviews_list");
ob_end_flush();
}


I hope it helps... It helped a lot on my site... I cached news, and all the lists...

_________________
Gry Online

Last edited by Bigboy177 on Sun Oct 02, 2005 4:57 pm; edited 1 time in total 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Oct 01, 2005 6:53 am Reply with quote

BigBoy,

Consider placing "Cache Lite" somewhere in your topic title. This is good info and it would be good for others just looking at Topic title's to see Cache Lite specifically.

Thanks and regards,
montego

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Bigboy177







PostPosted: Sun Oct 02, 2005 4:58 pm Reply with quote

montego wrote:
BigBoy,

Consider placing "Cache Lite" somewhere in your topic title. This is good info and it would be good for others just looking at Topic title's to see Cache Lite specifically.

Thanks and regards,
montego


I changed the topic... Wink
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Making Nuke Efficient

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©