osCommerce Community Support Forums: oscommerce suddenly running very slow? - osCommerce Community Support Forums

Jump to content

Corporate Sponsor


Tips and Tricks Guidelines

Tips and tricks are only allowed to be posted in this forum channel. For support, please post in another related channel in this forum. If you come across a post not related to a tip or trick, please report it so it can be deleted.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

oscommerce suddenly running very slow? $request_type changes solved the problem Rate Topic: -----

#1 User is offline   FWR Media Icon

  • Find Posts
  • Group: Community Member
  • Posts: 4,003
  • Joined: 02-July 05
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 11 October 2007 - 10:55 AM

I identified today the main reason that my oscommerce sites had become very slow loading so below is the solution in the hope that it helps someone.

Do I have this problem?
Check the images on non secure pages, if they are loading as https then you have the same problem. Also viewing source will show that the base href for non secure pages is https.



In catalog/includes/application_top.php the following line sets the request type SSL or not.

// set the type of request (secure or not)
$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

For whatever reason my server was always returning ON even when not an SSL request.

This causes the base href of non secure pages to be https and causes ALL images to load as https://www.mysite.com/thisimage.php causing massive slowdown.

Changing the line to ...

// set the type of request (secure or not)
$request_type = (getenv('SERVER_PORT') == '443') ? 'SSL' : 'NONSSL';

Works, at least on my server.

Hope this helps someone.
Got problems with Ultimate Seo Urls or just want more?
Ultimate Seo Urls 5 - Modern Seo Urls for PHP5

I offer help freely on these forums but personal contact (PM etc) I view as consultancy, for which I charge. To avoid disappointment please don't send me a personal message unless you are willing to pay for my services.

Are you a help Vampire?
0

#2 User is offline   FWR Media Icon

  • Find Posts
  • Group: Community Member
  • Posts: 4,003
  • Joined: 02-July 05
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 28 November 2007 - 10:51 AM

it is also necessary to make this change in ...

catalog/includes/functions/general.php

tep_redirect

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page


change to

if ( (ENABLE_SSL == true) && (getenv('SERVER_PORT') == '443') ) { // We are loading an SSL page

Got problems with Ultimate Seo Urls or just want more?
Ultimate Seo Urls 5 - Modern Seo Urls for PHP5

I offer help freely on these forums but personal contact (PM etc) I view as consultancy, for which I charge. To avoid disappointment please don't send me a personal message unless you are willing to pay for my services.

Are you a help Vampire?
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic