You are here: Documentation » API Reference » SimplePie » set_cache_duration()
Table of Contents
set_cache_duration()
Description
class SimplePie { set_cache_duration ( [int $seconds = 3600] ) }
Set the minimum time (in seconds) for which a feed will be cached.
Availability
- Available since SimplePie 1.0.
- Previously existed as cache_max_minutes() since SimplePie Preview Release.
Parameters
seconds
The number of seconds to cache for. 60
is 1 minute, 600
is 10 minutes, 900
is 15 minutes, 1800
is 30 minutes.
Examples
Change the cache duration
$feed = new SimplePie(); $feed->set_feed_url('http://simplepie.org/blog/feed/'); $feed->set_cache_duration(1800); $feed->init(); $feed->handle_content_type(); echo $feed->get_title();
See Also
reference/simplepie/set_cache_duration.txt · Last modified: 2011/03/06 03:56 (external edit)