Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customers Also Purchased function SLOW


imcrow

Recommended Posts

I am having an issue on a couple of our more popular products in OSC. A couple of our top-selling items also cause the "customers also purchased" function to take 10 to 20 seconds to load. I have added an inded to the sql table.

 

Here is an example:

http://www.greenhousecatalog.com/topsy-turvey-p-181.html

 

When I disable the also purchased function, the page loads flawlessly.

 

Any suggestions?

 

TIA!

Link to comment
Share on other sites

I am having an issue on a couple of our more popular products in OSC. A couple of our top-selling items also cause the "customers also purchased" function to take 10 to 20 seconds to load. I have added an inded to the sql table.

 

Here is an example:

http://www.greenhousecatalog.com/topsy-turvey-p-181.html

 

When I disable the also purchased function, the page loads flawlessly.

 

Any suggestions?

 

TIA!

 

I personally use "ap-preselection" which basically runs the also purchased logic (actually even more extensive as osc only counts the products purchased in the very same order as also purchased, this one includes all products the same customer purchased ) on all products in a scheduled job daily and fills a runtime result table which simply links product A to product B as in for product A -> product B is also purchased.

 

Queries on that table are obviously much faster to access online.

Treasurer MFC

Link to comment
Share on other sites

Are you using caching? It seems to me that is the best solution. It refreshes often enough for most purposes, and keeps you from calling the database every time, which is what sounds like is the problem.

 

Matt

Link to comment
Share on other sites

Are you using caching? It seems to me that is the best solution. It refreshes often enough for most purposes, and keeps you from calling the database every time, which is what sounds like is the problem.

 

Matt

 

yes, caching will solve a lot of performance problems. I use it a lot out of mere necessity.

 

But still, someone has to create those cache files once in a while for every product and with 20-30 seconds they are not the lucky ones.

Treasurer MFC

Link to comment
Share on other sites

But still, someone has to create those cache files once in a while for every product and with 20-30 seconds they are not the lucky ones.

 

use the spiders.

if($spider_flag && //cache is old enough)

// run cache recreate

Link to comment
Share on other sites

use the spiders.

if($spider_flag && //cache is old enough)

// run cache recreate

 

Do you stick that in /catalog/index.php and I suppose you must turn the spider option in admin on?

BACKUP your current files before editing. Did I mention to BACKUP your current files, first?

 

"I'm not a hero, I'm a firefighter; it is my job to save lives. I'm a Jesus Christ Firefighter saving souls from the flames!"

 

Installed contribs: Almost XP Buttons *** Attribute Sort *** Auto Thumbnail Change *** Column Product Listing (for SPPC v4.0) *** Contact Us Registered *** Country-State Selector 1.3.3J *** CC# Db Mask 1.3 *** Email Order Clickable Link *** Extra Images *** Linkpoint API CVM *** Loginbox Best *** New Spiders *** New Attrib Mgr v.5.0 w/ New Attrib Include *** Multi Product Update *** MySQL Cron *** Pricing per Category *** Product Listing in Columns v2.2 [later upgraded to CPL(SPPC)] *** Product Sort v1.6 *** Seperate Pricing Per Customer v4.15 *** Simple Down for Maintenance [Gokou] *** Ultimate_SEO_URLs_v2.2.2 *** UPS Worldship Export 1.3 *** Welcome Email username & password

Link to comment
Share on other sites

use the spiders.

if($spider_flag && //cache is old enough)

// run cache recreate

 

true, but it still remains a game of who gets to a non-cached or expired product page first.

if an individual page takes 20-30 seconds to load, solve that I would say.

Treasurer MFC

Link to comment
Share on other sites

Are you using caching? It seems to me that is the best solution. It refreshes often enough for most purposes, and keeps you from calling the database every time, which is what sounds like is the problem.

 

Matt

 

Caching was not turned on. I enabled it, loaded the problematic pages, and it seems to have helped quite a bit. Thanks for the tip!

 

Brian

Link to comment
Share on other sites

true, but it still remains a game of who gets to a non-cached or expired product page first.

if an individual page takes 20-30 seconds to load, solve that I would say.

Depends how the cache operates. I set it up for spiders to update, I know spiders visit say at least once a day, I setup the cache update to say 3 days. Now theoretically users would never have to go through the cache update because spiders are assigned for this task. Now if I update a product from the osc admin I could automatically update the cache for the products at the same time.

 

I am using some ideas from the cache contributions (I am not talking about the default cache) and most queries with static info (like product listings, categories etc) go through the cache first.

 

Unless it is critical to update the cache, (does the "also purchased" needs to be done immediately? I mean it could be done after a day or so by the spiders) there shouldn't be a problem.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...