我有一个表格,其中包含来自MySQL-PHP的7500多行数据。该应用程序基于Codeigniter 3构建。我没有使用数据表。但是,每次加载页面时,呈现时间都超过 15 秒。我尝试过使用页面缓存,但即使使用浏览器后退按钮也会从头开始加载页面。控制器方法:public function index() { $data['title'] = 'Patient List'; $data['patient'] = $this->patient_model->get_patients(); if(isset($_SESSION['patientChanged'])) { if($_SESSION['patientChanged'] == 1) { $this->output->delete_cache(); $this->output->cache(10); $_SESSION['patientChanged'] == NULL; } } $this->load->view('templates/header', $data); $this->load->view('patient_list'); $this->load->view('templates/footer');}public function insert() { $result = $this->patient_model->insert_patient(); $_SESSION['patientChanged'] = 1; redirect ('patient/view/'.$result);}有没有办法优化它?页面加载时间可以减少到5秒以下吗?
- 1 回答
- 0 关注
- 79 浏览
添加回答
举报
0/150
提交
取消