min_cache_time

(ReachRSS >= 0.91)
min_cache_time -- Sets the minimum number of minutes before refreshing channels

Description

int min_cache_time ( [ int minutes ] )

If ReachRSS finds a ttl (time to live) setting in a channel, it will use that when determning how often to recheck / redownload the remote RSS file. However not all RSS documents supply this item, and some may specify a refresh rate that's too frequent for your likes. min_cache_time allows you to remedy both situations.

Note that the highest of the two values (the RSS document's ttl value and your max_cache_time() value) takes presidence. If no ttl is specified, or if the ttl is smaller than your max_cache_time(), your max_cache_time() value will be used. If, however, the ttl is higher than your max_cache_time() then the ttl will be respected.

Note that setting max_cache_time() to a value that's too low can impact performance on your site as well as annoy the person or company providing the RSS service you're using. 60 minutes is the normal RSS standard, and is the recommended value (also the default).

If minutes is set, this function will set the number of minutes to keep items. min_cache_time() returns the previous cache time value, which means if called without the seconds parameter you can determine the current number.

Example 1. min_cache_time() example

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

This example will instruct ReachRSS to recheck RSS feeds no more than once every 2 hours and will print the previous time (by default 60 = 1 hour).

See also update_channel(), update_all_channels()

Back to Function List

 

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