Developer forum

Forum » Ecommerce - Standard features » Discount cache

Discount cache

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

We are having some less than optimal experience with Discounts cache.

 

I understand that Discounts are cached when they are requested for the first time the application runs. I was asked to look at it and see if there's anything that can be improved, as some times seem to be longer than expected.

 

I looked at how this runs and noticed a few things.

 

  • How much more efficient would it be to cache the objects themselves instead of just the index?
    I did look into the "CreateCopy" method that does a MemberwiseClone(). I know it to be most performant method to do cloning within an acceptable number of objects (except a manual clone process, but the maintainability on that is not great), but I wonder if caching the object itself would not be better for a discount intensive website.

     
  • After each discount save, the entire discount cache is cleared, instead of selectively updating the specific cache key

     

Best Regards,

Nuno Aguiar


Replies

 
Nicolai Pedersen
Reply

This code is salesdiscounts which are deprecated....

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Oh boy! You're right. I thought I was onto something. So allow me to start-over...

We're noticing 30-45sec for Discounts to be cached (the first time someone adds a product to the cart). I was asked to look into it and see if there's anything that can be done to improve this, since there's only about 40 active discounts, because it seems to be an awful amount of time.

 

Is there anything that you can think of that can be achieved?

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
Reply

Can you provide a link to the solution? Would like to give those discounts a look.

Thanks, Nicolai

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Sure thing. It's www.lillenas.com 

(And we're not using Querys for Products on this site. The customer "wants it", but they are using a workaround because of performance)

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum