• Catalog,  Commerce,  Episerver

    Refactoring Commerce catalog code, a story

    It is not a secret that I am a fan of refactoring. Clean. shorter, simpler code is always better. It’s always a pleasure to delete some code while keeping all functionalities: less code means less possible bugs, and less places to change when you have to change. However, while refactoring can bring a lot of enjoying to the one who actually does it, it’s very hard to share the experience: most of the cases it’s very specific and the problem itself is not that interesting to the outside world. This story is an exception because it might be helpful/useful for other Commerce developer.

  • Catalog,  Commerce,  Episerver,  Order,  Performance

    Commerce batching performance – part 2: Loading prices and inventories

    UPDATE: When looked into it, I realize that I have a lazy loading collection of entry codes, so each test had to spent time to resolve the entry code(s) from the content links. That actually costs quite a lot of time, and therefore causing the performance tests to return incorrect results. That was corrected and the results are now updated. In previous post we talked about how loading orders in batch can actually improve your website performance, and we came to a conclusion that 1000-3000 orders per batch probably yields the best performance result. But orders are not the only thing you would need to load on your website. A…

  • Commerce,  Episerver,  Order,  Performance

    Commerce batching performance – part 1: Loading orders

    One of best practices for better performance – not just with Commerce or Episerver Commerce, is to batch your calls to load data. In theory, if you want to load a lot of data, loading by both end will be problematic: if you load each record one by one, the overhead for opening the connection and retrieve data will be too much. But if you load all of them, then it is likely that you will end up with either time out exception in database end, or out of memory exception in your application. The better way is to of course, loading them by smaller batch: either 10, 20, or…

  • Catalog,  Commerce,  Episerver

    Speed up your catalog indexing performance – part 2

    Almost two years ago I wrote part 1 here: https://vimvq1987.com/speed-catalog-entries-indexing/ on how to speed up your catalog indexing performance. If you have a fairly big catalog with frequent changes, it might take longer time than necessary to build the index incrementally. (Rebuild index, in other hands, just delete everything and rebuild from scratch, so it is not affected by the long queue in ApplicationLog). I have seen some cases where rebuilding the entire index, is actually faster than waiting for it to build incrementally. The tip in previous blog post should work very well if you are using anything lower than Commerce 11.6, but that is no longer the case!

  • Commerce,  Debugging,  Episerver

    A curious case of memory dump diagnostic: How Stackify can cause troubles to your site

    It’s been a while since my last blog post, and this time it will be fun time with windbg. One of DXC customers has been having problem with instances of their site hang and restart. We at Episerver takes the availability and performance of DXC sites very seriously, therefore I was asked to help diagnosing the problem. It’s something I’d like to do and to learn anyway, so game is on. The golden standard for looking at the kind of those problems is still the tried and trusted Windbg. With the help from the Managed Services Engineer, I was able to access several memory dumps from the site. Most of…

  • Book,  Commerce,  Episerver

    Episerver Commerce: A problem-solution approach is now draft complete

    6 months ago I announced that I was working on a second book on Episerver Commerce. Unlike the first one where I tried to provide a systematic approach about the framework, this book focuses on the bite-size recipes, each one is a solution to solve a real world problem. It’s one problem solved, at a time. The world is big and the possibilities are endless, there might be more than one solution to a problem, but I tried to give the best one to my knowledge, experience. I hope that by talking about it, I also give information about how the API:s work, what to use, what should be avoided.…

  • Catalog,  Commerce,  Episerver

    Getting all non published variations

    I got a question from a colleague today: A customer has multiple languages (8 of them). They need to make sure all variants are published in all languages. That is of course a reasonable request, but there is no feature builtin for such requirement. But good news is that can be done with ease. If you want to try this as practice, go ahead – I think it’s a good exercise for your Episerver Commerce-fu skills. To do this task, we need the snippet to traverse the catalog from here https://leanpub.com/epicommercerecipes/read_sample

  • CMS,  Commerce,  Episerver

    Watch out for Singletons

    If you are a seasoned Episerver developer, you should (and probably, already) know about the foundation of the framework: dependency injection. With the Inversion of control framework (most common, Structuremap, but recent versions of Framework allow much more flexible options), you can easily register your implementations, without having to manually create each and every instance by new operator. Sounds great, right? Yes it is. And Episerver Framework allows you to make it even easier by this nice ServiceConfiguration attribute: [crayon-5bf44a451921e546649382/] so your class will be automatically registered, and whenever you need an instance of MyClass, IoC framework will get the best instance for you, automatically, without breaking a sweat. Isn’t it nice?…

  • Catalog,  Commerce,  Episerver

    Multiple catalogs: Without catalog name(s)

    My previous blog posts about multiple catalogs in multiple sites setting here and here has helped one customer (hopefully more) to address their problem. They tried the approach and it works for them. Now they came back and ask if they can remove the catalog name from the URL entirely. Is that something that can be done. Fortunately, yes. Before moving on, let’s be clear: this is obviously custom development and is not officially supported by Episerver. I.e. it’s neither tested and documented. Normally you would have to go to Expert Services for such requirement. For this blog, I provide those samples for free (you don’t even have to buy…

  • gaming,  reviews

    Super short review of Mario + Rabbids: Kingdom Battle

    Mario + Rabbids: Kingdom Battle is the second Switch game I played, and the first one I actually enjoyed. Plus: It’s a Mario game Beautiful and vibrant world designs. In fact it might be the most cute game I’ve played. Can’t wait to play it with my children (but given it’s rated ESRB 7+, it’ll be quite some time. It’s XCOM without creepy creatures and scary moments. It does not have the strategy/tactical depth XCOM 2 has to provide, but it’s fun nonetheless. It’s easy to restart a battle and play differently for different outcome. The game is, surprisingly, smooth on Switch. Can’t say the same for XCOM 2 on…