Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

These support forums are now closed for new topics and comments.
Please head on over to for support.

  • Johan Larsson 28 posts 98 karma points
    Jan 28, 2015 @ 13:55
    Johan Larsson

    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?

  • Jesper Nielsen 141 posts 498 karma points
    Jan 29, 2015 @ 10:21
    Jesper Nielsen

    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,

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 29, 2015 @ 15:43
    Søren Spelling Lund

    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.

  • Johan Larsson 28 posts 98 karma points
    Feb 03, 2015 @ 20:38
    Johan Larsson

    Thank you!

    I am using uCommerce 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


  • higgsy 65 posts 92 karma points
    Apr 28, 2015 @ 00:13

    Was there ever a response to this?

Please Sign in or register to post replies

Write your reply to: