[eluser]ChrisMiller[/eluser]
You are using it wrong in a bit of a way...
Code:
<?php
class caching extends CI_Controller{
function __construct()
{
parent::__construct();
$this->load->driver('cache');
}
function index()
{
// Attempt to get the item
if( ! $item = $this->cache->get('item') )
{
// No Luck so save it again
// Save into the cache for 5 minutes
$this->cache->save('item', 'Some Value', 300);
}
// Output Item
echo $item;
}
}