Reputation: 22810
OK, the question may sound familiar - and I've read answers about it everywhere BUT (before you point me to some other answer) none of that has worked for me (htaccess modifications, gzip-ping beforehand, etc).
So, let me explain you the situation :
http://localhost/~drkameleon/mysitename
.htaccess
file I've edited (and that, only for CI-oriented rewritting) resides on the very same directory as my CI installationSo, how do I enable JS/CSS gzip compression? (I don't really care even if the scripts are pre-compressed, they're 100% static anyway...)
Upvotes: 0
Views: 452
Reputation: 10996
I have this through a controller that loads the css and javascript files in two different functions, then run this:
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
ob_start("ob_gzhandler");
else ob_start();
// headers
// output
ob_end_flush();
Seems to be doing the trick for me.
Upvotes: 1