vishavjeet

singh.vishavjeet11@gmail.com

How can create cache in Codeigniter?

Posted on February 15, 2021



public function index(){

 $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));

if($this->cache->apc->is_supported()) echo 'driver is available';

else echo 'driver is not available';

if(!$this->cache->get('homePage'))

{

$myArray = array('one'=>1, 'two'=>2);

$this->cache->save('homePage', $myArray, 300);

echo 'cache not available';

}

$showCache =null;

$showCache = $this->cache->get('homePage');

var_dump($showCache);die();


}


Sign In for comment and like the post.