Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Compressing Pages


spooks

Recommended Posts

I would check your htaccess file, I get HTTP/1.1 200 OK

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.

Link to comment
Share on other sites

  • Replies 80
  • Created
  • Last Reply

Hi Sam

 

Thanks for your reply to my question 6 months ago. :)

 

I had to switch gzip compression off because a 500 Internal Server Error prevents spiders from crawling my site.

I never did find the cause of the problem.

 

Regards

 

Ken

Link to comment
Share on other sites

Sorry, I have many threads & I can't watch them all.

 

I would suspect an error with the library function on your server, its not windows by any chance?

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.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Every now and then I go mining through the osCommerce site looking for stuff like this. I wasn't aware what the GZip aspect could do. Enabling that and putting in Sam's code in the admin side made both sides much quicker. Thank you Sam!!

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

  • 2 months later...

A side benefit of using compression that hasn't been pointed out before is bandwidth. ;)

 

Thats to say the bandwidth used on each access is dramaticaly reduced, so if your hosting has a limit on bandwidth use, it will take a lot lot longer for you to use that up once you enable. :D

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.

Link to comment
Share on other sites

  • 1 month later...

What level of compression (1-10) would you recommend Spooks? I have set mine to 5.

Also, can I measure the CPU strain on server using the Load Average in order to get this number right for my server? I know I should use 'Top' really but guess this is the same sort of thing?

Link to comment
Share on other sites

  • 4 weeks later...

Hi

 

When I enable GZip and go here to test it.

 

http://www.gidnetwork.com/tools/gzip-test.php

 

However below this it also tells me that the Response Headers have changed from a status of HTTP/1.1 200 OK to HTTP/1.1 500 Internal Server Error

 

Is this anything to worry about?

 

Regards

 

Ken.

 

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?

Absinthe Original Liquor Store

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Absinthe Original Liquor Store

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 month later...

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!!

 

 

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.

Link to comment
Share on other sites

 

it sounds like there are problems with gzip on the server, the best place to ask is your host to confirm its fully functional. wink.gif

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.

Link to comment
Share on other sites

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!

 

it sounds like there are problems with gzip on the server, the best place to ask is your host to confirm its fully functional. wink.gif

Link to comment
Share on other sites

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!!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

 

image_error.jpg

 

Any suggestions what I may have done wrong?

 

Thanks in advance!

Link to comment
Share on other sites

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!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...