template_cache_time

(ReachRSS >= 0.91)
template_cache_time -- Sets the number of seconds to cache parsed template

Description

int template_cache_time ( [int seconds] )

In order to speed up performance, templates are only rebuilt when they're out of date. This includes when the template .tpl file is updated, when new items are added to channels, or when template_cache_time() expires since the last build time. If your web site has a lot of visitors you can increase performance (slightly) by setting this value higher. It defaults to 60 seconds in order to keep the "time since" values up to date. To disable template caching completely, call template_cache_time with a value of 0.

If seconds is set, this function will set the template cache time that ReachRSS will use when parsing templates for use with output() and save().

template_cache_time() returns the previous cache time, which means if called without the template parameter you can determine the current cache time.

Example 1. template_cache_time() example

$ReachRSS = new ReachRSS();
$Prev = $ReachRSS->template_cache_time(120);
print $Prev;

This example will set the template cache time to 120 seconds and print the previous cache time (by default "60").

See also template_filename(), output(), save()

Back to Function List

 

Home | Features | Samples | Demo | Download | Register | Help / Support