NameSilo

Simple gz compression

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

GeorgeB

Established Member
Impact
1
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
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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(); ?
 
0
Close
Cool, didn't know that one! Thanks for sharing!
 
0
Close
oh! i hope i can use it any of my forum.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back