It seems that every time I get an product from uCommerce programmatically it always goes to the database and gets the product. How to get a product from cache? Is that possible or do I have to implement an own cache code for this?
Versions prior to 6.5 would cache most of the data retrieved from the database including the object itself as Jesper says, but 1-n relationships would always refresh the relationship from the database, e.g. product - variants.
Some aspects in uCommerce are not cached at all; primarily in the transaction sytem where orders, order lines, and things of that nature are always the most up to date information.
Could you let us know which version of uCommerce you're using and what the specific API in question is?
How to get products from cache?
It seems that every time I get an product from uCommerce programmatically it always goes to the database and gets the product. How to get a product from cache? Is that possible or do I have to implement an own cache code for this?
The nHibernate cahce should be in place, unless you specifically deactiveted it.
If you use Product.Get(myId), you should hit the first level cache.
Other requests should hit the second level cache.
The cache by default holds items for 3600 seconds = 1 hour. This can be configured in web.config in the <syscache> section.
Kind regards,
Jesper
Hi Johan,
Versions prior to 6.5 would cache most of the data retrieved from the database including the object itself as Jesper says, but 1-n relationships would always refresh the relationship from the database, e.g. product - variants.
Some aspects in uCommerce are not cached at all; primarily in the transaction sytem where orders, order lines, and things of that nature are always the most up to date information.
Could you let us know which version of uCommerce you're using and what the specific API in question is?
Hope this helps.
Thank you!
I am using uCommerce 6.1.0.14195 and here is some specific calls I do that I am wondering if it will be cached.
- UCommerce.EntetiesV2.Product.Find(p => p ....)
- SiteContext.Current.CatalogContext.CurrentCatalog.Categories
Was there ever a response to this?
is working on a reply...