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.
Latest News: (loading..)
oscommerce suddenly running very slow?
Started by FWR Media, Oct 11 2007 10:55 AM
7 replies to this topic
#-19
Posted 11 October 2007 - 10:55 AM
Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls
KissMT Dynamic SEO Meta & Canonical Header Tags
KissER Error Handling and Debugging
KissIT Image Thumbnailer
Security Pro - Querystring protection against hackers ( a KISS contribution )
If you found my post useful please click the "Like This" button to the right.
Please only PM me for paid work.
KissMT Dynamic SEO Meta & Canonical Header Tags
KissER Error Handling and Debugging
KissIT Image Thumbnailer
Security Pro - Querystring protection against hackers ( a KISS contribution )
If you found my post useful please click the "Like This" button to the right.
Please only PM me for paid work.
#-18
Posted 28 November 2007 - 10:51 AM
it is also necessary to make this change in ...
catalog/includes/functions/general.php
tep_redirect
change to
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
Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls
KissMT Dynamic SEO Meta & Canonical Header Tags
KissER Error Handling and Debugging
KissIT Image Thumbnailer
Security Pro - Querystring protection against hackers ( a KISS contribution )
If you found my post useful please click the "Like This" button to the right.
Please only PM me for paid work.
KissMT Dynamic SEO Meta & Canonical Header Tags
KissER Error Handling and Debugging
KissIT Image Thumbnailer
Security Pro - Querystring protection against hackers ( a KISS contribution )
If you found my post useful please click the "Like This" button to the right.
Please only PM me for paid work.
#-17
Posted 08 February 2010 - 10:03 AM
great... !! thank for your post
#-16
Posted 04 September 2010 - 03:18 AM
OMGoodness! What a difference this little change made!!!
#-15
Posted 29 March 2011 - 09:26 PM
I too was struggling with this. SSL was not my problem, it was a poorly optimized mysql. top showed mysqld was continusouly pegged at 100%+ sometimes almost 200% and response time was dreadfully. slow. Google clocked us at an average 11.9 seconds per page, some pages taking more than 30 seconds to load. For an ecommerce site, that kind of response is death. I tried the SSL trick, but found our pages were not loading https until checkout (which is what you want). It was clear that mysql was the problem. I tried optimizing all of the tables (I wrote a short php script to do this) but no joy. Then I thought perhaps I had a semaphore problem with ibdata - according to SHOW ENGINE INNODB STATUS that was most likely not the case. Then I sat and watched what queries were exactly being executed using SHOW FULL PROCESSLIST repeatedly and using copy and paste executing those queries so I could see how long they were taking. Any query that took longer than .5 seconds (some were over 10 seconds!) grabbed my attention. I noted from the query all of the fields that were either involved in a JOIN or WHERE clause and made sure that field had an index created for it in the appropriate tables. I ended up creating about 10 indexes that were not already present and now my site flies. Well, as much as can be expected for a site with 8000+ products and 350+ categories utilizing most of the features available (visit www.pilotshop.com for details). If there was a better way, I'd like to hear it.
Tom
Tom
#-14
Posted 19 April 2011 - 04:50 PM
Pilotshop, on 29 March 2011 - 09:26 PM, said:
I too was struggling with this. SSL was not my problem, it was a poorly optimized mysql. top showed mysqld was continusouly pegged at 100%+ sometimes almost 200% and response time was dreadfully. slow. Google clocked us at an average 11.9 seconds per page, some pages taking more than 30 seconds to load. For an ecommerce site, that kind of response is death. I tried the SSL trick, but found our pages were not loading https until checkout (which is what you want). It was clear that mysql was the problem. I tried optimizing all of the tables (I wrote a short php script to do this) but no joy. Then I thought perhaps I had a semaphore problem with ibdata - according to SHOW ENGINE INNODB STATUS that was most likely not the case. Then I sat and watched what queries were exactly being executed using SHOW FULL PROCESSLIST repeatedly and using copy and paste executing those queries so I could see how long they were taking. Any query that took longer than .5 seconds (some were over 10 seconds!) grabbed my attention. I noted from the query all of the fields that were either involved in a JOIN or WHERE clause and made sure that field had an index created for it in the appropriate tables. I ended up creating about 10 indexes that were not already present and now my site flies. Well, as much as can be expected for a site with 8000+ products and 350+ categories utilizing most of the features available (visit www.pilotshop.com for details). If there was a better way, I'd like to hear it.
Tom
Tom
Hi, Im getting similar problems with my site loading. I have over 12000 products can you shed some light on to achieve faster loading time. www.desirablescents.biz
Edited by Jan Zonjee, 19 April 2011 - 05:43 PM.
#-13
Posted 04 May 2011 - 04:58 AM
Pilotshop, on 29 March 2011 - 09:26 PM, said:
I too was struggling with this. SSL was not my problem, it was a poorly optimized mysql. top showed mysqld was continusouly pegged at 100%+ sometimes almost 200% and response time was dreadfully. slow. Google clocked us at an average 11.9 seconds per page, some pages taking more than 30 seconds to load. For an ecommerce site, that kind of response is death. I tried the SSL trick, but found our pages were not loading https until checkout (which is what you want). It was clear that mysql was the problem. I tried optimizing all of the tables (I wrote a short php script to do this) but no joy. Then I thought perhaps I had a semaphore problem with ibdata - according to SHOW ENGINE INNODB STATUS that was most likely not the case. Then I sat and watched what queries were exactly being executed using SHOW FULL PROCESSLIST repeatedly and using copy and paste executing those queries so I could see how long they were taking. Any query that took longer than .5 seconds (some were over 10 seconds!) grabbed my attention. I noted from the query all of the fields that were either involved in a JOIN or WHERE clause and made sure that field had an index created for it in the appropriate tables. I ended up creating about 10 indexes that were not already present and now my site flies. Well, as much as can be expected for a site with 8000+ products and 350+ categories utilizing most of the features available (visit www.pilotshop.com for details). If there was a better way, I'd like to hear it.
Tom
Tom
Hi Tom,
I have visited your site and I can tell that you've done a terrific job on optimization. I have been trying to do the same with indexing all intensively used table joins and I will eventually have over 180K items on our site, in which 60K will be in stock and available. Now aside from us using a heavily modded Year/Make/Model lookup, the site is pretty much stock and it loads decent on FireFox, Chrome & Safari...however in Internet Explorer (using 8), it loads very slow and I cannot figure out why.
Do you know of any ideas to help?
Thank you!
PS: Excellent site you got there. I will recommend it to a friend of the family, as he is a pilot for American Airlines...
-Chris
#-12
Posted 30 August 2011 - 08:55 PM
To all OsCommerce hackers: Guys, very soon I will be behind you, and you'll have to kneel !!!
P.S I've found a way to track them.
P.S I've found a way to track them.









