Enable GZIP on a PHP server?
I was going on a binge to increase speed of my website and optimize what I can within reason, one thing I wanted to go into was editing some Apache/MySQL configurations so I can decrease page loading time, I wanted to try something with .htaccess
but I hate 500 errors that ensues, as I got PHP I'm wishing to do GZIP compression there.
What would I add, and some pointers on how I should implement it in my own code?
And also, GZIP is a part of what开发者_高级运维 compression library?
Conventionally you would only need to add ob_start("ob_gzhandler")
to the first of your page, be sure you output no content beforehand and it will take care of all of the rest for you. You may want to ensure the browser isn't Netscape (3) as it can't handle GZ encodings.
And also, GZIP is a part of what compression library?
GZIP is part of the ZLib library, and thus requires it as a dependancy.
You can get more information on php.net site ( php.net/ob_start for examplle )
精彩评论