News:

Support the VirtueMart project and become a member

Main Menu

Double cache for RSS

Started by mrodriguez, January 31, 2014, 13:49:10 PM

Previous topic - Next topic

mrodriguez

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:


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):


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


I think above code should be replaced by this one:

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




  • Joomla version: Joomla! 2.5.16
  • VirtueMart version: 2.0.26d

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/