Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

Compressing Pages


80 replies to this topic

#61 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 31 October 2009, 14:52

View Postmr_absinthe, on 31 October 2009, 12:40, said:

Hi Sam,

I'm also experiencing the same error as above.

- If I keep it "ON" in admin - ERROR
- If I turn it "OFF" - no error, no compression
- If I turn it "OFF" and add ob_start("ob_gzhandler"); - ERROR

I was suspecting .htaccess but after loading vanilla .htaccess, I see no difference, still error with Gzip "ON".

I have created test store - vanilla install on the same server and there is no error with compression "ON". Do you have any idea what might be causing the error?


Speak to your host, sounds like a issue with gzip on your server.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#62 mr_absinthe

  • Community Member
  • 411 posts
  • Real Name:Alex
  • Location:London, UK

Posted 31 October 2009, 18:09

View Postspooks, on 31 October 2009, 14:52, said:

Speak to your host, sounds like a issue with gzip on your server.
Thanks for your reply, but test store - clean osC installation on the very same server runs without issues and it is compressed with no erros...?

I have two stores on the same server:

/catalog/ - that is a copy of the live store - errors when gzip enabled

/test/ - clean install 2.2rc2a - no errors and compressed

Those two test sites share the same database. /catalog/ is heavily modified, is there particular part that could have been affected in the code thus the errors? They run on php 5.3.0.

I've compared gzip_compression.php files in both - identical. The code (// if gzip_compression is enabled, start to buffer the output) in application_top.php is also identical.

Edited by mr_absinthe, 31 October 2009, 18:24.

Absinthe Original Liquor Store

#63 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 31 October 2009, 21:26

View Postmr_absinthe, on 31 October 2009, 12:40, said:

Hi Sam,

I'm also experiencing the same error as above.

- If I keep it "ON" in admin - ERROR
- If I turn it "OFF" - no error, no compression
- If I turn it "OFF" and add ob_start("ob_gzhandler"); - ERROR

I was suspecting .htaccess but after loading vanilla .htaccess, I see no difference, still error with Gzip "ON".

I have created test store - vanilla install on the same server and there is no error with compression "ON". Do you have any idea what might be causing the error?


All the command does is tell the server to enable compression for your pages, your other code is irrelavent, if it dont work its a server issue, perhaps it requires a different command format, Speak to your host.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#64 mr_absinthe

  • Community Member
  • 411 posts
  • Real Name:Alex
  • Location:London, UK

Posted 02 November 2009, 08:43

View Postspooks, on 31 October 2009, 21:26, said:

All the command does is tell the server to enable compression for your pages, your other code is irrelavent, if it dont work its a server issue, perhaps it requires a different command format, Speak to your host.
I just wanted to make sure since the problem is on php5.3.0. I'll let you know the output, thank you.
Absinthe Original Liquor Store

#65 mr_absinthe

  • Community Member
  • 411 posts
  • Real Name:Alex
  • Location:London, UK

Posted 02 November 2009, 15:18

For all those having similar difficulties... It was caused by .user.ini and application_top.php - error reporting.

To make it work as wanted, I had to keep this in .user.ini:

display_errors = 1
error_reporting = 2

and change application_top.php to:

// set the level of error reporting
// error_reporting(E_ALL & ~E_NOTICE);
error_reporting(0);

Changing display_errors = 0 in .user.ini did not help nor was working when I removed it and kept only register_globals = 0 for example. No idea why it is must be done like this but it is working.... uff :sweating:
Absinthe Original Liquor Store

#66 minipassat

  • Community Member
  • 81 posts
  • Real Name:minipassat

Posted 04 December 2009, 03:01

Hello, I have similar problems like yours. I got error messages when GZip is enabled; or Gzip is off but add the code "ob_start("ob_gzhandler");" as instructed by spooks. I am not sure if it's because of the OSC version. Here are the error messages:

In godaddy and powweb hosting, OSC version is MS2, PHP version 4+

in IE6: blank page

in IE7: Internal Server Error - Read
The server encountered an internal error or misconfiguration and was unable to complete your request.
Reference #3.96f6a9ce.1259895023.0

in Firefox 3.5.5 - tells me the unsupported compression method is used.

However in Hostexcellence hosting, OSC version is RC2, PHP version 4+, GZip is enabled, the website is compressed and working fine! Do you or anyone know what might be wrong?

Thank you very much!!


View Postmr_absinthe, on 31 October 2009, 18:09, said:

Thanks for your reply, but test store - clean osC installation on the very same server runs without issues and it is compressed with no erros...?

I have two stores on the same server:

/catalog/ - that is a copy of the live store - errors when gzip enabled

/test/ - clean install 2.2rc2a - no errors and compressed

Those two test sites share the same database. /catalog/ is heavily modified, is there particular part that could have been affected in the code thus the errors? They run on php 5.3.0.

I've compared gzip_compression.php files in both - identical. The code (// if gzip_compression is enabled, start to buffer the output) in application_top.php is also identical.


#67 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 05 December 2009, 09:47

View Postminipassat, on 04 December 2009, 03:01, said:


it sounds like there are problems with gzip on the server, the best place to ask is your host to confirm its fully functional. [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#68 minipassat

  • Community Member
  • 81 posts
  • Real Name:minipassat

Posted 06 December 2009, 04:20

Hi Sam,

I actually checked with Powweb and they don't provide GZip for their platform. For Godaddy server, they told me to insert the following code in index.php:

After review of the hosting account the script provided earlier needs to be added to the index.php for the compression to function. With compression enabled in the Admin of the OsCommerce software we are unable to assist if that has caused the site to go have issues.

Add the following code to the very top of your Web pages above the DOCTYPE:

<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>


I placed the code in index.php or includes/application_top.php or sts_template.html but non of it worked. Any possible solution?

Thank you!

View Postspooks, on 05 December 2009, 09:47, said:

it sounds like there are problems with gzip on the server, the best place to ask is your host to confirm its fully functional. [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]


#69 minipassat

  • Community Member
  • 81 posts
  • Real Name:minipassat

Posted 07 December 2009, 05:27

okay, I did some search from the internet and someone shared that Godaddy doesn't support GZip, however Godaddy says they do support it.

Since the store I have on HostExcellence hosting is GZip compatible and functioning well, so I decided to create a sub-folder there and throw all the files used in Godaddy into that folder just to test if it's the server issue. The answer is - when GZip is enabled in admin, the client side is NOT working. Therefore I think maybe my files are somehow causing the issue? Here is what I have:

OSC Version: 2.2 MS2
major Installed Modules: Header Tags SEO, Additional Images, FEC (fast easy checkout), Ultimate SEO URLs

Is any of these modules not causing any problem to GZip? Need help please!!
Thank you very mcuh!!

#70 minipassat

  • Community Member
  • 81 posts
  • Real Name:minipassat

Posted 07 December 2009, 07:10

or is it possible the Big5 or Utf8 issue? Thanks.

#71 pete2007

  • Community Member
  • 335 posts
  • Real Name:Peter Online
  • Gender:Male

Posted 07 December 2009, 12:38

View Postspooks, on 27 May 2008, 23:14, said:

There is a option in admin, so if you have that 'on' don`t apply this to the client side.

This can be done for any php document.

In application_top.php both on client side & admin, near the top, after <?php

add:

ob_start("ob_gzhandler");

Hi,

My settings in admin >Configuration >GZip Compression, are currently set to; False & 5

What settings do you recommend? Shall I also add the code to application_top.php ?

Thanks in advance!

#72 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 07 December 2009, 13:10

View Postpete2007, on 07 December 2009, 12:38, said:

Hi,

My settings in admin >Configuration >GZip Compression, are currently set to; False & 5

What settings do you recommend? Shall I also add the code to application_top.php ?

Thanks in advance!


Set the admin setting to true & just add the code to your admin side application top
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#73 pete2007

  • Community Member
  • 335 posts
  • Real Name:Peter Online
  • Gender:Male

Posted 07 December 2009, 13:22

View Postspooks, on 07 December 2009, 13:10, said:

Set the admin setting to true & just add the code to your admin side application top

Hi,

Thanks for the response.

Doesn't it matter what the Compression Level needs to be?

#74 pete2007

  • Community Member
  • 335 posts
  • Real Name:Peter Online
  • Gender:Male

Posted 08 December 2009, 09:56

Hi,

I changed the setting in admin, then I added the code just after <?php

To: store/osc/includes/application_top.php
And: store/osc/admin/includes/application_top.php

I now get the following error:

[img]http://i5.photobucket.com/albums/y193/peter14789/image_error.jpg[/img]

Any suggestions what I may have done wrong?

Thanks in advance!

#75 minipassat

  • Community Member
  • 81 posts
  • Real Name:minipassat

Posted 08 December 2009, 23:00

Hi, please ignore my previous post. (sorry I don't think it'd let me delete from the froum). I found that Godaddy does supports Gzip for OSC. I reinstall the original OSC (both RC2a and MS2 version) files and the GZip works fine. So I think the error message must caused by the modules I used which conflict with GZip. I am new to PHP and the site is heavely modified, does any know that enabling GZip might conflict with any of the modules below and what to check or how to fix:

  • Additional Images
  • Header Tags SEO
  • Ultimate SEO
  • Fast and Easy Checkout
  • STS3 (template)
  • Sub-Category Description
  • FAQ System
  • Product Sort
  • Related Products
  • Discount Coupon Codes
  • Tiny MCE (Disabled)
  • FCK Editor
  • Export to CSV
  • Google Sitemap
Thank you!!

#76 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 09 December 2009, 11:50

View Postpete2007, on 08 December 2009, 09:56, said:

Hi,

I changed the setting in admin, then I added the code just after <?php

To: store/osc/includes/application_top.php
And: store/osc/admin/includes/application_top.php

I now get the following error:

[img]http://i5.photobucket.com/albums/y193/peter14789/image_error.jpg[/img]

Any suggestions what I may have done wrong?

Thanks in advance!

As the instructions states, if you have enabled the option in admin, DO NOT add the code to the store side. [img]http://forums.oscommerce.com/public/style_emoticons/default/cool.gif[/img]

Whenever you add anything & it don't work, triple check you followed the instructions to the letter!! [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#77 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 09 December 2009, 11:53

View Postminipassat, on 08 December 2009, 23:00, said:

Hi, please ignore my previous post. (sorry I don't think it'd let me delete from the froum). I found that Godaddy does supports Gzip for OSC. I reinstall the original OSC (both RC2a and MS2 version) files and the GZip works fine. So I think the error message must caused by the modules I used which conflict with GZip. I am new to PHP and the site is heavely modified, does any know that enabling GZip might conflict with any of the modules below and what to check or how to fix:

  • Additional Images
  • Header Tags SEO
  • Ultimate SEO
  • Fast and Easy Checkout
  • STS3 (template)
  • Sub-Category Description
  • FAQ System
  • Product Sort
  • Related Products
  • Discount Coupon Codes
  • Tiny MCE (Disabled)
  • FCK Editor
  • Export to CSV
  • Google Sitemap
Thank you!!

Others have reported failures with STS
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#78 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 16 March 2010, 21:18

I've just come across this site that has a nice explanation of the gzip compression method & looks at the pro's & cons involved.

betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#79 broadstreetbully

  • Community Member
  • 69 posts
  • Real Name:jason

Posted 09 October 2010, 01:26

works great! thanks!!:thumbsup:

#80 poorgirl_richgirl

  • Community Member
  • 43 posts
  • Real Name:Tracey Gordon
  • Gender:Female

Posted 02 January 2012, 21:44

Hello. thx. The above code did not help. Are these any more suggestions?