Welcome Guest, Not a member yet? Register   Sign In
Cache question
#1

[eluser]term25[/eluser]
Is my approach correct, I mean if the position above the other code in function for

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

when I want to cache results of this controller for 10 minuis the best practice in my controller or not:


Example:

Quote:
class Articles extends CI_Controller {

function __construct()
{



parent::__construct();



$this->load->model('page_model');

}

public function index()
{

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

$data['pages'] = $this->page_model->get_pages();

$this->load->view('all_view', $data);



}

function cars()
{

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

$data['pages'] = $this->page_model->get_pages_cars();

$this->load->view('cars_view', $data);



}

Is this correct or should I do it differently?

Thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB