EllisLab text mark
Advanced Search
     
Database Caching in Codeigniter
Posted: 28 February 2013 06:11 AM
Joined: 2012-04-25
28 posts

Hi,
I have configure the site with multiple outlets and creating the cache for each outlet.
The cache path as follow

$db['default']['cachedir''application/cache/outlet1/';
$db['default']['cachedir''application/cache/outlet2/'

Now if the category is changed in admin panel i want to clear the cache for each outlet.
Is it possible to set the cache path at run time so that cache for each outlet i.e “outlet1” and “outlet2” can be cleared.
I’ve tried to set the path at run time in my controller as below

$db['default']['cachedir''application/cache/outlet1';
$this->db->cache_delete_all();

$db['default']['cachedir''application/cache/outlet2';
$this->db->cache_delete_all(); 

but it clear the cache file of outlet1 whic is set in

application/config/database.php