max_time

(ReachRSS >= 0.91)
max_time -- Sets the maximum number of seconds to keep each item in the cache

Description

int max_time ( [ int seconds ] )

In order to keep your data fresh ReachRSS only keeps items in the cache for as they are relivant to - max_time() allows you to specify that value. max_time() currently applies to all channels - there isn't a way to specify different max_time for different channels. Once an item has been in the cache for this period of time it will be removed automatically.

Note that this time period starts when an item is retrieved for the first time, not from the date the item was published. So if you retrieve a feed with items from 30 days ago, they'll still remain in your cache for max_time() seconds before expiring.

If seconds is set, this function will set the number of seconds to keep items.

max_time() returns the previous max time value, which means if called without the seconds parameter you can determine the current number.

Example 1. max_time() example

$ReachRSS = new ReachRSS();
$Prev = $ReachRSS->max_time(60*60*24*7);
print $Prev;

This example will instruct ReachRSS to keep items for up to 7 days and print the previous time (by default 3024000 = 2 weeks).

See also max_items()

Back to Function List

 

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