VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Topic started by: mrodriguez on January 31, 2014, 13:49:10 pm

Title: Double cache for RSS
Post by: mrodriguez on January 31, 2014, 13:49:10 pm
Virtuemart Admin Panel shows two RSS feeds (Extensions Feed and VirtueMartRss Feed) using SimplePie library. SimplePie use cache by default but virtuemart also use Joomla cache system.

On /administrator/components/com_virtuemart/helpers/shopfunciotns.php, line 794, getCPsRssFeed() uses Joomla caché system:

Code: [Select]
static public function getCPsRssFeed($rssUrl,$max) {

$cache_time=86400*3; // 3days
$cache = JFactory::getCache ('com_virtuemart_rss');
$cached = $cache->getCaching();
$cache->setLifeTime($cache_time);
$cache->setCaching (1);
$feeds = $cache->call (array('ShopFunctions', 'getRssFeed'), $rssUrl, $max);
$cache->setCaching ($cached);
return $feeds;
}

And on the same file, line 830, SimplePie are used (with default params, cache enabled):

Code: [Select]
static public function getRssFeed ($rssURL,$max) {
jimport('simplepie.simplepie');
$rssFeed = new SimplePie($rssURL);

I think above code should be replaced by this one:

Code: [Select]
static public function getRssFeed ($rssURL,$max) {
jimport('simplepie.simplepie');
$rssFeed = new SimplePie();
$rssFeed->enable_cache(false);
$rssFeed->set_feed_url($rssURL);
$rssFeed->init();


Title: Re: Double cache for RSS
Post by: Milbo on January 31, 2014, 21:13:00 pm
This are different caches. We use the cache too automatically reload teh stuff after 3 days. We dont want to delay the normal work in the BE.