1
kenogui
Gzip compression really working ?
  • 2004/2/17 13:24

  • kenogui

  • Just popping in

  • Posts: 25

  • Since: 2004/1/19


Hi all,

after making several tests and comparisons between gzip compression on / off, I'm not sure there is real difference.

If I use several tools to analyze source code produced by xoops:

http://www.websiteoptimization.com/services/analyze/

http://leknor.com/code/gziped.php

http://www.edginet.org/cgi-bin/http_head.cgi (don't forget to check the Gzip detection box)

all of them reply me there is no compression used by xoops, and I'm sure to have turn the option ON.

So I'm quite confuse about this important feature, and I would like to be sure that Gzip is really working on xoops.

I know XOOPS code is very "clean" and well-written, so I'm a little bit surprised about this if it's not working.

Thx.

2
kenogui
Re: Gzip compression really working ?
  • 2004/2/19 13:17

  • kenogui

  • Just popping in

  • Posts: 25

  • Since: 2004/1/19


No one knows something about that ???

Xoops core team, please !!!

3
ackbarr
Re: Gzip compression really working ?

I took a quick look at this yesterday, and it looks like there is indeed a problem with gzip encoding with xoops2. We will be taking a closer look at this problem shortly.

4
kenogui
Re: Gzip compression really working ?
  • 2004/2/19 14:52

  • kenogui

  • Just popping in

  • Posts: 25

  • Since: 2004/1/19


aahhhh yes, I'm happy to find an answer following my discover.

With the Gzip encoding there is no secret, to be completely sure that it's working, you should and you must check apache log files, and see the content size of the sent page with and without gzip. You will see a great loss of size or not. It's the only real, secure way to verify the Gzip.

A lot of people are thinking to use gzip on their website, but in fact, it's really easy to be wrong. It's not only a simple call to a gz_handler() function which will make it ...

please take a look at jpcache http://www.jpcache.com/ which is the best gzip encoding / cache algorithm available for PHP. If you use this on a website, you can be sure to have on-the-fly gziped website.

And in term of performance, I think XOOPS need a good Gzip, because it's not "really" fast ... (but I still like a lot XOOPS which the best CMS I ever used ! )

5
Dave_L
Re: Gzip compression really working ?
  • 2004/2/19 15:58

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


... to be completely sure that it's working ...

You can also look for "Content-Encoding: gzip" in the HTTP response headers for .php pages.

6
ackbarr
Re: Gzip compression really working ?

for the mozilla / firebird users among us, a great tool to see the page headers used is LiveHTTPHeaders. Those using IE on NT, 2000, or XP can use ieHTTPHeaders to get similar information.

7
ackbarr
Re: Gzip compression really working ?

since XOOPS already uses smarty for content caching, I wouldn't think it to be desirable to switch to or add a different caching engine.
Until this bug is fixed, if you want to ensure that your pages are gzip encoded you can disable the "Use gzip compression" setting in System -> Preferences -> General Settings and add the following to XOOPS_ROOT/.htaccess
php_flag zlib.output_compression on
php_value zlib
.output_compression_level 5


zlib.output_compression_level can be from 1 to 9, with 9 being the highest compression. Normal settings are usually between 3 and 6.

Please note that your host must be using Apache and has to allow you to create .htaccess files for this workaround to function.

8
Jan304
Re: Gzip compression really working ?
  • 2004/2/19 16:34

  • Jan304

  • Official Support Member

  • Posts: 520

  • Since: 2002/3/31


well, I fixed it as follow:

Open include/functions.php and replace:
ob_start('ob_gzhandler');

with:
if ($xoopsConfig['gzip_compression'] == 1) {
        
$phpver phpversion();
        
        
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
        
        if ( 
$phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
        {
         if ( 
extension_loaded('zlib') )
         {
          
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');
          }
         }
        }
       } else {
        
ob_start();
    }


Hope this helps some other people. Oh btw, I took this code from somebody on php.net (shame )

9
pemen
Re: Gzip compression really working ?
  • 2004/2/19 17:21

  • pemen

  • Not too shy to talk

  • Posts: 186

  • Since: 2002/7/8 7


For me with these modifications my site is still not using gzip.

?????

10
Jan304
Re: Gzip compression really working ?
  • 2004/2/19 17:25

  • Jan304

  • Official Support Member

  • Posts: 520

  • Since: 2002/3/31


Are you sure it is set ON? (System Admin - Settings - GZIP Compression). And if that isn't it, is the gzip mod loaded in apache?

Oh btw, to the XOOPS developers, this might be interesting:
http://leknor.com/code/php/class.gzip_encode.0.62.php.txt

Login

Who's Online

183 user(s) are online (71 user(s) are browsing Support Forums)


Members: 0


Guests: 183


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits