Reputation: 24645
I'm developing RSS feed widget for Magento. Now I need to use Magento cache to store feeds, so that feeds are not loaded on every request. How can I store my own items to Magento cache or is that possible at all?
What I need is :
// My item
$myItem = "My feed";
// Put stuff to cache
$cache->put("MyCacheId", $myItem);
// Get stuff from cache
$cache->get("MyCacheId");
Upvotes: 0
Views: 423
Reputation: 54
Mage_Core_Model_App::saveCache($data, $id, $tags=array(), $lifeTime=false)
is your desired method here.
In core you'll often find method access like follow:
Mage::app()->saveCache(serialize($myData), $myCacheKey, ...)
Good luck.
Upvotes: 1