This is a little trick to compress PHP files when transmitted from web server into web browser using standard PHP functions. This method will save bandwidth and increase your web speed.
First method, using zlib extension.
You can only do this if your web server support zlib extention.
Php code |
'zlib.output_compression',1); |
Second method, using ob_start() function. Call ob_start() function with ob_gzhandler will compress the output. Just call this function on the top of every script you have.
Php code |
('ob_gzhandler'); /* put any code below */ |
No comments:
Post a Comment