I have a function:
function _dc_election_races_get_articles($search_term)
{
$search_url = 'http://feeds.example.com/vote_up/search.php?search='.rawurlencode($search_term);
if ($cached = cache_get($search_url, 'cache'))
{
$results = $cached->data;
}
else
{
$results = json_decode(file_get_contents($search_url));
cache_set($search_url, $results, 'cache', 60*60*3); //3 hours
}
return $results;
}
I basically want the cache to expire after 3 hours and re-fetch the data from the url. The documentation on drupal made it seem like that it might not be removed from cache after 3 hours. Will cron cleanup caches?