Author Topic: Double cache for RSS  (Read 893 times)

mrodriguez

  • Beginner
  • *
  • Posts: 1
Double cache for RSS
« 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();


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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Double cache for RSS
« Reply #1 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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/