Php Codeigniter缓存单个

Php Codeigniter缓存单个,php,codeigniter,caching,Php,Codeigniter,Caching,我有以下职能: class Pharmacy extends MY_Controller { function __construct() { parent::__construct(); } function index() { $data['pack'] = $this->package(); $data['name'] = $this->getNa

我有以下职能:

   class Pharmacy extends MY_Controller {

        function __construct() {
            parent::__construct();
        }

        function index() {

            $data['pack'] = $this->package();
            $data['name'] = $this->getName();
            $data['title'] = $this->title();
            $data['name'] = $this->getName();
            $data['tests'] = $this->get_tests();
            $data['patient_bio'] = $this->patient_bio();
            $data['procedure_name'] = $this->getProcedure();

           //Pass the contents of pharmacy view to the  template view. 
            $data1['contents'] = 'pharmacy';
            $finaldata = array_merge($data, $data1);
            $this->base_params($finaldata);
        }

        function base_params($data) {
          //Load the  base template for the function.
            $this->output->cache(3000);
            $data['title'] = 'Pharmacy';
            $this->load->view('template', $data);
        }
    }

我想缓存foloowing视图模板,但当我传递$this->output->cache(3000)时;它缓存整个网页,而不是只缓存模板视图。如何仅缓存模板视图

让您的数据(mysql)缓存而不是缓存模板怎么样?我认为模板视图在
base\u params()中?还是要缓存在
index()中的数据?还有,是什么让你想要缓存这些?它们是否占用了大量的开销或加载时间较长?