• 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-5c0ede9ed6b96225147142/] 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?…

  • CMS,  Episerver,  IIS

    Adding backslash ending to your URLs by UrlRewrite

    It’s generally a best practice to add a backslash to your URLs, for performance reasons (let’s get back to that later in another post). There are several ways to do it, but the best/simplest way, IMO, is using UrlRewrite module. In most of the case, processing the Urls before it reaching the server code will be most effective, and here by using UrlRewrite we trust IIS to do the right thing. Our application does not even need to know about it. It’s also a matter of reusable. You can simply copy a working, well tested rule to another sites without having to worry much about compatibility. Before getting started, it’s worth…

  • CMS,  Commerce,  Episerver,  Performance,  SQL Server,  Uncategorized

    Maintaining your indexes

    Indexes are crucial to SQL Server performance. Having the right indexes might make the difference of day and night with your application performance – as I once talked here. However, even having the right indexes is not everything. You have to keep them healthy. Indexes, as any other kinds of storage, is subjected to fragmentation. SQL Server works best if the index structure is compact and continuous, but with all of the inserts/updates/deletes, it’s inevitable to get fragmented. When the fragmentation grows, it starts affecting the performance of SQL Server: Instead of having to read just one page, it now have to read two, which increases both time and resource…

  • CMS,  Commerce,  Episerver,  Uncategorized

    Episerver caching issue with .NET 4.7

    Update 1: The bug is fixed in .NET 4.7.1 (thanks to Pascal van der Horst for the information) Update 2: The related bug is fixed in CMS Core 10.10.2 and 9.12.5. If upgrading to that version is not an option, you can contact Episerver support service for further assistance. Original post: If you are using Episerver and update to .NET 4.7 (even involuntarily, such as you are using DXC/Azure to host your websites. Microsoft updated Azure to .NET 4.7 on June 26th) , you might notice some weird performance issues. If your servers are in Europe, Asia or Australia, then you can see a peak in memory usage. If your servers in…

  • CMS,  Episerver,  Performance,  Uncategorized

    Episerver CMS performance optimization – part 1

    Update: In Episerver CMS 11, released today (November 21st 2017), the simpleaddress router has been moved to the last of the route table. Original post: This is an unusual post – it is not about Commerce – my area of expertise, but about CMS. Recently I’ve been working on some support cases where SQL Server instance is on high utilization, and in some scenarios it eventually slows down the site. After investigation, it’s likely to come from a small, simple and helpful feature: Simple address. CMS content can have a property named “Simple address”, which allows you to create a “shortcut” url for that content. So if you have one page…