I have a codeigniter website that runs beautifully on localhost, but now that I have moved it to Host gator some page requests are taking around 30 seconds to serve up, if loaded at all! The weird thing is that is seemingly random, and while waiting for the page to load, if I simply re-click the link the page will load normally. I’m not sure if this is a programming problem in my controllers (code below) or just issues on host gators end. Please plesse please someone help me out here, as I am going insane.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Company extends CI_Controller
{
function __construct()
{
parent::__construct();
if (!$this->session->userdata('language')) $this->session- >set_userdata('language', 'en');
}
function index ()
{
$tags['title'] = 'title tag';
$this->load->view($this->session->userdata('language').'/includes/view_header',$tags);
$this->load->view($this->session->userdata('language').'/company/view_company');
$this->load->view($this->session->userdata('language').'/includes/view_footer');
}
function warranty ()
{
$tags['title'] = 'title tag';
$this->load->view($this->session->userdata('language').'/includes/view_header',$tags);
$this->load->view($this->session->userdata('language').'/company/view_warranty');
$this->load->view($this->session->userdata('language').'/includes/view_footer');
}
}
I suggest you to test with codeigniter profiler, It will show all the processing time like sql execution etc…
When enabled a report will be generated and inserted at the bottom of your pages.
To disable the profiler you will use:
For more details http://codeigniter.com/user_guide/libraries/output.html
Hope this will help you, let us know if anything there… Thanks!!