Skip to content

CodeIgniter GZIP

Last updated on January 17, 2018

CodeIgniter is one of the PHP MVC Framework with minimum learning curve best documentation and easy workflow, in CodeIgniter we can easily Enable or Disable GZIP Compression by Changing Config array values (TRUE – Enable and False – Disable ).gzip is a good technique to reduce size of page with size reduction speed increases, faster load is better for SEO

In your config file change compress_output to TRUE. This Enable Output compression, default value is FALSE it means output compress is off by default.

// application/config/config.php
 $config['compress_output'] = TRUE;


Note:
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.

Enable Gzip in Codeigniter / Ajax Issue :

Do not “echo” any values with compression enabled. By using it you may end up with 500 internal

5 1 vote
Article Rating
Subscribe
Notify of
guest

3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments