kathyisawesome / wc-mnm-variable

Variable Mix and Match Products
2 stars 0 forks source link

Performance issues when switching subscriptions #9

Closed helgatheviking closed 1 year ago

helgatheviking commented 1 year ago

When loading the variable form via ajax (like in Subscription switching), we're seeing load times from 5-25 seconds! eeek!

Presumably this is because we're loading the full images in the available variation HTML for each variation up to the ajax threshold. So if you have a lot of variations and a lot of images, this is NOT going to scale well. Eventually this might pose a problem on the single product page... it's surprising that it doesn't seem effected yet as it is the same problem on loading all the HTML in the available variation array.

Thoughts:

  1. set threshold to zero and always fetch single variation via ajax. can we then stash that variation so we don't have to fetch it a second time?
  2. Fetch the MNM form itself via Ajax when the variation is found?
  3. do we need to fetch all the images multiple times if sharing contents? slight chance the min/max/step is filtered at the variation level (well really no chance right now b/c there's only 1 user, but technically it's possible)