NamePros.Com (http://www.namepros.com/)
-   CODE (http://www.namepros.com/code/)
-   -   Simple gz compression (http://www.namepros.com/code/101433-simple-gz-compression.html)

GeorgeB 06-24-2005 08:38 AM

Simple gz compression
 
Want to use gz compression on your PHP pages to compress pages and save bandwidth without affecting performance?

Use the PHP ob_gzhandler callback function.

Here is an example of it's use:

Code:
<?php ob_start("ob_gzhandler"); ?> <html> <body> <p>This should be a compressed page.</p> </html> <body>

That's right... a simple line at the beginning of your PHP file is all it takes! Try it yourself in your own custom, paid, or free PHP applications :)

Note: ob_gzhandler() requires the zlib extension.

More FREE helpful tutorials like this one at www.georgeboone.com

Porte 06-24-2005 11:27 AM

Hey George, I use currently at my custom script one page only index.php which calls all other pages as includes depending on the 'mode' value. Do I input this line in the index page only? or the includes as well? ~

And it needs to become at the very top right below session_start(); ?

i386 06-29-2005 02:26 AM

Cool, didn't know that one! Thanks for sharing!

hasif 07-01-2005 11:56 AM

oh! i hope i can use it any of my forum.


All times are GMT -7. The time now is 02:00 AM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0