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 installation So, 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...)
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.