codeigniter cache example

codeigniter cache example

Enable Cache by putting the following code in any controller :


$this->output->cache(n);

Where n is number of minutes
Note :
Make Sure “application/cache” folder is writable.

Full Example :

function your_controller()
{
       $this->output->cache(2); //cache page for 2 minute
       $this->load->view('your_view'); 
}

You can also use the data base caching for improving the performance of the system.

Please do not use the database before understanding it to avoid the real time data and cache data issues.


Advertisements

Add Comment

📖 Read More