Enable Gzip Compression
Enabling gzip compression is very easy in CodeIgniter, Just Open Config.php file, it is located at application/config/config.php, Will find
$config['compress_output'] array set this value to true
/* |-------------------------------------------------------------------------- | Output Compression |-------------------------------------------------------------------------- | | Enables Gzip output compression for faster page loads. When enabled, | the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it | means you are prematurely outputting something to your browser. It could | even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called | by the output class. Do not 'echo' any values with compression enabled. | */ $config['compress_output'] = TRUE;
Enable full page Cache
Enable full page Cache for each Controller or methods, by calling $this->output->cache(n),Will expire in n minutes,
How Full page Cache Works
If you Request a page Codeigniter does a hash of the current URL and if it finds that file name in the cache directory, it serves that page,
Otherwise it Create fresh hash file, There is no Methods are available for Deleting full page Cache , you have to Delete manually to get fresh Content.
although this method of caching is useful Small sites
To Enable full page Cache just Call $this->output->cache(n), here n is time
$this->output->cache(60); // Will expire in 60 minutes
Compress HTML output
last but not list , HTML output compress is most use full to speed up website , Please visit my previous post for HTML output compress
