Please, help me... I can not set the TTL cache for the Joomla module. This is -
$cache->setLifeTime(20);
- not working.
My code:
$cache = & JFactory::getCache('my_custom_mod', '');
$cacheKey = (string)$urls->serialize();
if (!($data = $cache->get($cacheKey))){
foreach ($urls as $i => $url){
$data[$i] = file_get_contents($url);
}
$cache->setLifeTime(20);
$cache->store($data, $cacheKey);
}
Any ideas? Thanks for your advice.