You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 355 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - GZIP Speed and Compression (It Works!) [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
RonS
Nuke Cadet
Nuke Cadet


Joined: Apr 02, 2004
Posts: 2


PostPosted: Thu Apr 01, 2004 11:53 pm Reply with quoteBack to top

Just wanted to pop in and mention that the GZIP compression doesn't further compress the images in coppermine, just the text.

Other than that, it works just as advertised: extremely well!

___________________
Everything about Old English Sheepdogs
www.oes.org
Find all posts by RonSView user's profileSend private messageVisit poster's website
DaveTomneyUK
Lieutenant
Lieutenant


Joined: Sep 03, 2003
Posts: 162

Location: UK, England

PostPosted: Thu Aug 19, 2004 5:13 am Reply with quoteBack to top

How would I add this to my site if I enable GZIP inside the forums admin it says GZIP is allready enabled but if I goto the site http://www.desilva.biz/gzip-test.php it says its disabled. THis is my mainfile posted below if anyone can point me in the right direction.

Code:

<?php

   unset($matches);
   unset($loc);

if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", rawurldecode($loc=$_SERVER["QUERY_STRING"]), $matches)) {
   die();
}

if (stristr($_SERVER["QUERY_STRING"],'%20union%20')) header("Location: index.php");
   $phpver = phpversion();

if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
   ob_end_clean();
   ob_start('ob_gzhandler');
  }
} else if ($phpver > '4.0') {

if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (extension_loaded('zlib')) {
   $do_gzip_compress = TRUE;
   ob_start();
   ob_implicit_flush(0);
   //header('Content-Encoding: gzip');
    }
  }
}
   $phpver = explode(".", $phpver);
   $phpver = "$phpver[0]$phpver[1]";

if ($phpver >= 41) {
    $PHP_SELF = $_SERVER['PHP_SELF'];
}

if (!ini_get("register_globals")) {
    import_request_variables('GPC');
}
Find all posts by DaveTomneyUKView user's profileSend private messageVisit poster's website
nobleclem
Lieutenant
Lieutenant


Joined: May 27, 2003
Posts: 167

Location: Southfield, MI

PostPosted: Thu Aug 19, 2004 12:36 pm Reply with quoteBack to top

1) disable it on the forums
2) follow this posts instructions and it should work... at least it has for me: http://nukecops.com/postp100004.html#100004

_________________
....Check Out These Great Sites....


http://HackerAssassins.com is home to PHP-Nuke 7.4 HA Enhanced | http://FatalException.us

http://Vaelio.com < -- > The Future of CMS Technology and Design Today -- coming soon
Find all posts by nobleclemView user's profileSend private messageVisit poster's websiteAIM AddressMSN MessengerICQ Number
VinDSL
Site Admin
Site Admin


Joined: Jul 08, 2003
Posts: 1193

Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs

PostPosted: Thu Aug 19, 2004 1:01 pm Reply with quoteBack to top

nobleclem wrote:
1) disable it on the forums...

Correct! NEVER compress twice. That's ALWAYS a no-no!

_________________
.:: "The further in you go, the bigger it gets!" ::.
.:: VinDSL's Lenon.com | The Disipal Site ::.
Find all posts by VinDSLView user's profileSend private messageVisit poster's websiteICQ Number
DaveTomneyUK
Lieutenant
Lieutenant


Joined: Sep 03, 2003
Posts: 162

Location: UK, England

PostPosted: Thu Aug 19, 2004 3:30 pm Reply with quoteBack to top

Did I add it right as you can see my mainfile.php i'm not sure if I did but my site is a lot faster now.

Code:

<?php

function nuke_getRootPath() {
   $ret  = "./";

if (eregi('\/modules\/[^\/]+\/[^\/]+\/[^\/]+.php$', $_SERVER['PHP_SELF'])) {
   $ret = "../../../";
} else if (eregi('\/modules\/[^\/]+\/[^\/]+.php$', $_SERVER['PHP_SELF'])) {
   $ret = "../../";
} else if (eregi('\/modules\/[^\/]+.php$', $_SERVER['PHP_SELF'])) {
   $ret = "../";
}
   return $ret;
}
   require_once(nuke_getRootPath().'includes/asfunc.php');

   unset($matches);
   unset($loc);

if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", rawurldecode($loc=$_SERVER["QUERY_STRING"]), $matches)) {
   die();
}

if (stristr($_SERVER["QUERY_STRING"],'%20union%20')) header("Location: index.php");
   $phpver = phpversion();

if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
   ob_end_clean();
   ob_start('ob_gzhandler');
  }
} else if ($phpver > '4.0') {

if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (extension_loaded('zlib')) {
   $do_gzip_compress = TRUE;
   ob_start();
   ob_implicit_flush(0);
  }
}

if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (extension_loaded('zlib')) {
   $do_gzip_compress = TRUE;
   ob_start();
   ob_implicit_flush(0);
   //header('Content-Encoding: gzip');
    }
  }
}
   $phpver = explode(".", $phpver);
   $phpver = "$phpver[0]$phpver[1]";

if ($phpver >= 41) {
    $PHP_SELF = $_SERVER['PHP_SELF'];
}

if (!ini_get("register_globals")) {
    import_request_variables('GPC');
}


I think I may have added to much code, I'm not sure i've never used GZIP. Any help would be appreciated.
Find all posts by DaveTomneyUKView user's profileSend private messageVisit poster's website
nobleclem
Lieutenant
Lieutenant


Joined: May 27, 2003
Posts: 167

Location: Southfield, MI

PostPosted: Thu Aug 19, 2004 4:33 pm Reply with quoteBack to top

VinDSL wrote:
PART II - The Forrest Gump Code
" Life is like a box o' chocolates..."

Here's what I do...

Replace this code at the top of 'mainfile.php':

Code:
(snip)

$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
    if (extension_loaded('zlib')) {
        ob_end_clean();
        ob_start('ob_gzhandler');
    }
} else if ($phpver > '4.0') {
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
        if (extension_loaded('zlib')) {
            $do_gzip_compress = TRUE;
            ob_start();
            ob_implicit_flush(0);
            //header('Content-Encoding: gzip');
        }
    }
}

(snip)



...with:


Code:
(snip)

$phpver = phpversion();
if ($phpver >= '4.0.4pl1')
{
    ob_start('ob_gzhandler');
    }else if ($phpver > '4.0'){
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')){
        if (extension_loaded('zlib')){
            $do_gzip_compress = TRUE;
            ob_start();
            ob_implicit_flush(0);
            }
        }
    }

(snip)



"Stupid is as Stupid does, Sir...


Follow it... I am not seeing the replaced code in your mainfile.php

_________________
....Check Out These Great Sites....


http://HackerAssassins.com is home to PHP-Nuke 7.4 HA Enhanced | http://FatalException.us

http://Vaelio.com < -- > The Future of CMS Technology and Design Today -- coming soon
Find all posts by nobleclemView user's profileSend private messageVisit poster's websiteAIM AddressMSN MessengerICQ Number
telefotoguy
Nuke Cadet
Nuke Cadet


Joined: Jan 11, 2005
Posts: 2


PostPosted: Tue Jan 11, 2005 11:47 pm Reply with quoteBack to top

I applied your GZIP compression on 7.6 and it worked great thanks.

Savings:87% Very Happy
Find all posts by telefotoguyView user's profileSend private message
Hagionet
Nuke Cadet
Nuke Cadet


Joined: Jan 19, 2005
Posts: 2

Location: Bangladesh

PostPosted: Wed Jan 19, 2005 5:27 am Reply with quoteBack to top

only adding the code ozhandler will work properly.

Check with the name:
http://www.hagionet.info
http://www.aanchol.com

on any gziptester.

Theu are compressed with out editing mainfile.php

one can be see here:
Image

Cheezz..
http://www.hagionet.info

_________________
Leading Download Community:
http://www.hagionet.info

Premium Softwares, Ebooks Can be download.
Find all posts by HagionetView user's profileSend private messageSend e-mailVisit poster's websiteYahoo MessengerMSN Messenger
Jo0132
Sergeant
Sergeant


Joined: Feb 06, 2005
Posts: 135

Location: NEW YORK CITY

PostPosted: Mon Feb 07, 2005 7:26 pm Reply with quoteBack to top

It works!! Cool Thank You so Much!! Very Happy
Find all posts by Jo0132View user's profileSend private messageVisit poster's website
Akaveli
Captain
Captain


Joined: Jan 03, 2004
Posts: 501


PostPosted: Mon Mar 28, 2005 10:35 am Reply with quoteBack to top

Hi

Just uploaded phpinfo.php and launched it from my browser and got this info:

Code:
ZLib Support  enabled 
Compiled Version  1.1.4 
Linked Version  1.1.4 


Then i did as VIN-DSL and replaced the code in my mainfile.php and uploaded it. But when i test my site for g-zip it says non compressed...

Have i done something wrong?
Find all posts by AkaveliView user's profileSend private message
Akaveli
Captain
Captain


Joined: Jan 03, 2004
Posts: 501


PostPosted: Mon Mar 28, 2005 10:38 am Reply with quoteBack to top

Sorry my fault, it works Very Happy
Find all posts by AkaveliView user's profileSend private message
NewbieNuker
Nuke Cadet
Nuke Cadet


Joined: May 09, 2005
Posts: 6

Location: Cali

PostPosted: Mon May 09, 2005 6:32 pm Reply with quoteBack to top

Just tried this!

Sweet!!! Cool
Find all posts by NewbieNukerView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.082 Seconds - 430 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::