<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 68 Classifieds and Smarty Caching</title>
	<atom:link href="http://ericlbarnes.com/68classifieds/tips/68-classifieds-and-smarty-caching/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericlbarnes.com/68classifieds/tips/68-classifieds-and-smarty-caching/</link>
	<description>68 Classifieds, Business, Tech, Life, and Whatever else</description>
	<lastBuildDate>Wed, 03 Mar 2010 15:55:39 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John</title>
		<link>http://ericlbarnes.com/68classifieds/tips/68-classifieds-and-smarty-caching/comment-page-1/#comment-289</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 10 Jun 2009 13:47:20 +0000</pubDate>
		<guid isPermaLink="false">http://ericlbarnes.com/?p=378#comment-289</guid>
		<description>I&#039;ve used the caching, though I didn&#039;t need it globally.  For those users or developers who just want to turn it on for a page here is what you need to do:
&lt;code&gt;
//turn on/off caching
$class_tpl-&gt;caching = true;//true or false

//setup caching
$class_tpl-&gt;cache_dir = &#039;/path/to/cache&#039;;//by default this is already available FILESYSTEM_PATH/cache
$class_tpl-&gt;cache_lifetime = 1800; //seconds for cache to be retained (30 min)

//now check if page is already cached
if (!$class_tpl-&gt;is_cached(&#039;mypage&#039;)) {
    //page is not cached, you need to generate its content
   //code here....
}

$class_tpl-&gt;display(&#039;layout.tpl&#039;, &#039;mypage&#039;); //page generation skipped if is in cache
&lt;/code&gt;

If running PHP5 you shouldn&#039;t need to CHMOD the cache directory.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve used the caching, though I didn&#8217;t need it globally.  For those users or developers who just want to turn it on for a page here is what you need to do:<br />
<code><br />
//turn on/off caching<br />
$class_tpl-&gt;caching = true;//true or false</p>
<p>//setup caching<br />
$class_tpl-&gt;cache_dir = '/path/to/cache';//by default this is already available FILESYSTEM_PATH/cache<br />
$class_tpl-&gt;cache_lifetime = 1800; //seconds for cache to be retained (30 min)</p>
<p>//now check if page is already cached<br />
if (!$class_tpl-&gt;is_cached('mypage')) {<br />
    //page is not cached, you need to generate its content<br />
   //code here....<br />
}</p>
<p>$class_tpl-&gt;display('layout.tpl', 'mypage'); //page generation skipped if is in cache<br />
</code></p>
<p>If running PHP5 you shouldn&#8217;t need to CHMOD the cache directory.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
