Snowman Posted January 2, 2003 Share Posted January 2, 2003 GZIP Compression will speed up the time it takes for your osCommerce pages to load on most servers. The mod will now allow you to enable GZIP compression on your osCommerce website. GZIP compression can speed up the time it takes for a page to load. This code will also remove wasted whitespace from the pages and also checks to see if you have GZIP enabled on your server. If GZIP isnt enabled it wont do any compression and the page will load nomally To find out how much faster your pages could load try this tester GZIP Tester DOWNLOAD THE MOD HERE Quote Link to comment Share on other sites More sharing options...
Snowman Posted January 2, 2003 Author Share Posted January 2, 2003 hmmm what browser are you using??? does this site load on your browser? http://www.snowtechsports.com Not sure what the problem is...other than its possible that you have whitespace after the trailing ?> at the end of one of the files... check the header, footer, default.php and application top. If that doesnt work it may be an incompatability im not aware of. Quote Link to comment Share on other sites More sharing options...
Snowman Posted January 2, 2003 Author Share Posted January 2, 2003 Oh burt i must also say...nice site...how have you got your hosting signup setup??? Im building a signup/billing system based on osC at the moment. Quote Link to comment Share on other sites More sharing options...
Snowman Posted January 2, 2003 Author Share Posted January 2, 2003 hmmm trust it to not be fully compatable with every setup... :? :( Just check php.ini to make sure you dont already have the following compiled: output_handler = ob_gzhandler If you do i think its a bit of double dipping and hence it wont work Quote Link to comment Share on other sites More sharing options...
medisave Posted January 2, 2003 Share Posted January 2, 2003 like this mod and Im going to install it. However the gzip compression page you list - when I put your page in and run a test on the scnow sports one it comes back as not running gzip. Is this a problem with the code or does the site have a problem. Also I was wondering on older browser probs - will the page just not load if it cannot support gzip request in the browser or will it load an uncompressed one ? Cheers, Graham. Quote Graham Wright ________________ Link to comment Share on other sites More sharing options...
TB Posted January 4, 2003 Share Posted January 4, 2003 Steve, This mod is phenominal! The difference that it makes to my pages is.. well... (from one Aussie to another in a Steve Kirwin 'Croc Hunter' voice... 'You Ripper!') :D :D Only problem I've come across is that I'm using IIS 5 and my site is no longer showing locally. I have looked at my phpinfo and it shows the following: SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate Do you know if there's any way in IIS 5 to encode with gzip locally? (Prefered Option) :wink: If not, how do I switch it off so the pages are parse without the encoding? Thanks, Tony P.S. What are the downfalls of using gZip? (This seems too good to be true!) Am I just sacrificing CPU time, or will I run into compatibility problems with client browsers? Quote "The price of success is perseverance. The price of failure comes much cheaper." Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted January 4, 2003 Share Posted January 4, 2003 What are the downfalls of using gZip? (This seems too good to be true!)Am I just sacrificing CPU time, or will I run into compatibility problems with client browsers? Remember that it is just the HTML being compressed, not the images. The images are already compressed in either GIF or JPG or whatever. I have proposed a php/gzip feature internally and will spruce it up and contribute it soon. There is some logic to enable gzip compression only if the client supports it. Here are some rough benchmarks: default.php: Uncompressed length: 27774 Compressed length: 3753 product_info.php: Uncompressed length: 25908 Compressed length: 4045 checkout_confirmation.php: Uncompressed length: 25617 Compressed length: 3428 Quote , osCommerce Link to comment Share on other sites More sharing options...
TB Posted January 5, 2003 Share Posted January 5, 2003 Remember that it is just the HTML being compressed, not the images. The images are already compressed in either GIF or JPG or whatever. It does make a HUGE difference though... To see the layout of the page instantly is great... the speed of the HTML loading will surely take their mind of the fact that the images are a little slower. Which aren't even that much slower... since the HTML isn't taking up precious 56k bandwidth. (Sounds silly when talking 56k and bandwidth in the same sentence! :D) I have proposed a php/gzip feature internally and will spruce it up and contribute it soon. Can't wait! There is some logic to enable gzip compression only if the client supports it. What if the client doesn't support it? Will the pages just load as per normal without the compression? (I'm guessing that 'client' is meaning that it gets decoded on the client browser... from what versions of each browser is gZip in-built?) A little off the topic... I've download the Win32 gZip contribution so I can gZip my backups locally. Though the 'define' statements in 'admin/includes/application_top.php' are causing problems when I upload the file to my server/host. It doesn't gZip any more. :( Is there someway to incorporate an IF statement to see if you're on a local machine, then define them, but if you're on a www server to leave them alone? Also, can I use the gZip in this contribution to gZip my pages locally? (I'm using IIS 5 and Win2K) Thanks, Tony Quote "The price of success is perseverance. The price of failure comes much cheaper." Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted January 17, 2003 Share Posted January 17, 2003 I've commited the feature into the CVS repository and should work pretty well across environments. Quote , osCommerce Link to comment Share on other sites More sharing options...
radders Posted January 17, 2003 Share Posted January 17, 2003 There's an article here about the problems of reading compressed files with IE 5 and 6 under certain circumstances. http://lists.over.net/pipermail/mod_gzip/2...ber/006587.html Quote Link to comment Share on other sites More sharing options...
Snowman Posted January 18, 2003 Author Share Posted January 18, 2003 like this mod and Im going to install it. However the gzip compression page you list - when I put your page in and run a test on the scnow sports one it comes back as not running gzip. Is this a problem with the code or does the site have a problem. Also I was wondering on older browser probs - will the page just not load if it cannot support gzip request in the browser or will it load an uncompressed one ? Cheers, Graham. Try http://www.snowtechsports.com now! i hadnt done that one yet :) Quote Link to comment Share on other sites More sharing options...
radders Posted January 18, 2003 Share Posted January 18, 2003 What seems to happen is that rather than loading bit-by-bit there is a 10sec delay when nothing happens and then it all loads instantly (at least on broadband it does). Is that a feature of the compression? Quote Link to comment Share on other sites More sharing options...
Snowman Posted January 18, 2003 Author Share Posted January 18, 2003 (edited) no thats a feature of a very buggy old shop, and the way i have the code setup on it at the moment. The whole store will be going in for a rebuild when the milestone release comes out Edited September 29, 2005 by Johnson Quote Link to comment Share on other sites More sharing options...
lleahu Posted January 24, 2003 Share Posted January 24, 2003 actually, if you already have transparent zlib compression turned on in your php.ini, then this mod doesn't work Quote my@life# ./gf |touch|finger|mount|fsck|watch her her@life$ ./men|more Segmentation fault: Whore dumped Link to comment Share on other sites More sharing options...
lleahu Posted January 24, 2003 Share Posted January 24, 2003 actually what i really meant is that if your using the 2003/01/22 snapshot (which has this already included) with transparent zlib compression enabled, then adding this code to the store again broke things for me. :roll: Quote my@life# ./gf |touch|finger|mount|fsck|watch her her@life$ ./men|more Segmentation fault: Whore dumped Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted January 24, 2003 Share Posted January 24, 2003 actually what i really meant is that if your using the 2003/01/22 snapshot (which has this already included) with transparent zlib compression enabled, then adding this code to the store again broke things for me. Is the zlib compression enabled in php.ini or is it mod_gzip for Apache? The GZip feature in CVS checks to see if zlib compression is enabled in php.ini and disables itself if the GZip feature is enabled. There is currently no mod_gzip detection occuring. Quote , osCommerce Link to comment Share on other sites More sharing options...
lleahu Posted January 24, 2003 Share Posted January 24, 2003 its a PHP setting: zlib.output_compression = On Quote my@life# ./gf |touch|finger|mount|fsck|watch her her@life$ ./men|more Segmentation fault: Whore dumped Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted January 25, 2003 Share Posted January 25, 2003 its a PHP setting: zlib.output_compression = On Right. Here is the logic in application_top.php: 01: if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) { 02: if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) { 03: if (PHP_VERSION >= '4.0.4') { 04: ob_start('ob_gzhandler'); 05: } else { 06: include(DIR_WS_FUNCTIONS . 'gzip_compression.php'); 07: ob_start(); 08: ob_implicit_flush(); 09: } 10: } else { 11: ini_set('zlib.output_compression_level', GZIP_LEVEL); 12: } 13: } Line 2 checks to see if zlib.output_compression is enabled or not - if it is, it sets the compression level with the GZIP_LEVEL parameter, and that is all - no further gzippin' is occuring :D Quote , osCommerce Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.