EllisLab/CodeIgniter — pull request #1015 by dfreerksen (2012-02-04 22:45:01+00:00)
Title: Set global cache lifetime without having to specify the lifetime during each save() call

Load the cache drive with an additional 'lifetime' param (60 seconds by default):
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file', 'lifetime' => 300)); // 5 minutes

Save the cache without specifying a lifetime
$this->cache->save('foo', $bar);

You can still set the third param if you didn't want to use the default lifetime.
$this->cache->save('foo', $bar, 60);