Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

K Khan
Jun 19, 2019
  5389
(6 votes)

Best practises cheat sheet for your EPi site

  • Prefer Controllerless blocks
  • Don't Create Content Areas in Blocks, No nesting blocks.
  • Minimize database calls. Instead, use Episerver’s caching layer where ever possible.
  • Personalization might have an impact on performance, therefore make sure you implement personalization in a way that has the least possible impact.
  • Avoid frequent querying of the Dynamic Data Store.
  • Try to keep your content tree well balanced.
  • Prefer Lists over ContentArea where possible to avoid big content structures for complex pages.
  • Avoid dynamic properties.
  • Register UIDescriptor, where you disable on page edit and preview views
  • For settings kind of pages, ensure that it will not have a template
  • Use Episerver’s Object Cache instead of .NET’s built-in cache
  • Create all Content Types (Page Types, Block Types, Media Types) in code
  • For property (field) names in code, use standard .NET PascalCase. Make sure to set a friendly Display Name and Description
  • Plan a data hierarchy for Content Types, and use class inheritance
  • Organize groups of properties (fields) into tabs
  • Provide an order of properties, with frequently used properties at the top of each tab, Consider Editors
  • Set default values for Content Types’ Properties (if known)
  • For media properties, use the ContentReference type and the appropriate UIHint
  • Use the PropertyFor method to render properties (fields) in Content Type views
  • Make sure to always create the appropriate Media Types for assets in the project
  • Use Container Pages for folder nodes, without presentation (if required) use IContainerPage.
  • Plan carefully the content structure hierarchy, and avoid overloading a single level with too many pages
  • Make sure to load-test external systems integrations
  • Avoid resolving URLs repeatedly, think about cache.
  • Avoid creating blocks to use for image refernces and pages only along with some text as Alt

Disclaimer: Points have been learned from many different sources and experience, have been adding in my best practices document.

Jun 19, 2019

Comments

Praful Jangid
Praful Jangid Jun 20, 2019 08:05 AM

Thanks for listing out the checklist for the best practice. I have some questions like

  1. Why you want to avoid creating ContentArea on blocks?
  2. When you are saying personalization may have performance imapact. Are you just talking in reference of chaching or something else?

Thanks, and regards

Praful

K Khan
K Khan Jun 20, 2019 09:17 AM

1- Having Content areas in blocks open a wormhole for nested blocks, I will prefer to avoid by default, will prefer to discuss with the team if it really requires and see if this can be avoided. 

2- e.g. Custom Visitor Group Criteria depending on 3rd party services, can secretly effect performance, It will be hard to investigate, should be taken care in advance.

/K

Daniel Ovaska
Daniel Ovaska Jun 20, 2019 12:28 PM

1. I agree. Content Area in blocks might seem like a flexible solution yes. It can however get very difficult for editors and does also have some performance drawbacks. If possible, avoid nesting blocks in blocks except in rare cases. It's like most things. Blocks are great...in moderation. 

KennyG
KennyG Jun 20, 2019 03:09 PM

What do you suggest instead of nested blocks? PropertyList?

Praful Jangid
Praful Jangid Jun 20, 2019 06:35 PM

Thanks K Khan,

I see now, that using Block may create issue if not used properly. And for personalization, I never know that there are critetia's that may be using a third party service.

K Khan
K Khan Jun 20, 2019 08:53 PM

KennyG,

https://world.episerver.com/documentation/developer-guides/CMS/Content/Properties/generic-propertylist/

I will just echo Daniel. He explained it well 

/K

Stefan Holm Olsen
Stefan Holm Olsen Jun 21, 2019 07:52 AM

OMG, we must be twins, Khurram! šŸ˜‰

Joke aside. I see that some of the key points regarding performance optimizations looks very much like points I very recently wrote on my personal blog (on June 2).

Maybe it is a coincidence, maybe it is copy/paste. But can we please refer or provide links, if we publicly use or refer to the written work of someone else?

K Khan
K Khan Jun 21, 2019 08:13 AM

You are right, I have added a disclaimer at the end of the blog (as it might cause offence, but I am afraid don't have references for those), This was the collection that I have been collecting from many different resources and was adding in my best practises cheat sheet from many years.

For me above link isn't working, we might be replicating here as generally, we all practise those. Glad you are also sharing your experience and learning.

This site can’t provide a secure connection

stefanolsen.com sent an invalid response.

ERR_SSL_PROTOCOL_ERROR

K Khan
K Khan Jun 21, 2019 08:35 AM

@Stefan, Looks like your site needs some attention and isn't available to a big audience.

http://stefanolsen.com (Look out! Your Virgin Media Child Safe settings have blocked this site)
https://stefanolsen.com/ (This site can’t provide a secure connection)
https://www.stefanolsen.com/ (This site can’t provide a secure connection)

K Khan
K Khan Jun 21, 2019 08:35 AM

@Stefan, Looks like your site needs some attention and isn't available to a big audience.

http://stefanolsen.com (Look out! Your Virgin Media Child Safe settings have blocked this site)
https://stefanolsen.com/ (This site can’t provide a secure connection)
https://www.stefanolsen.com/ (This site can’t provide a secure connection)

Paul Gruffydd
Paul Gruffydd Jun 21, 2019 12:52 PM

Just to pick up on  KennyG's point, I think the solution to avoiding nested blocks depends on what you're using them for. In some circumstances list properties are absolutely the right option but they also have drawbacks to be aware of in that items aren't reusable (or individually previewable), you can't apply personalisation, localisation is tricky (to put it mildly) and, as it says at the top of the documentation, they aren't officially supported.

One of my pet hates when it comes to nested blocks is to use them just to represent a containing element, for example grouping accordion blocks into an accordion container block. As well as the performance implications, this adds to the work editors have to do to maintain a site. My preferred approach in that scenario is to modify the content area renderer to look for items which should be grouped together (e.g. instances of AccordionItemBlock) and to inject the relevant markup around them.

KennyG
KennyG Jun 21, 2019 02:01 PM

Hey Paul that's an interesting approach to grouping in the content area renderer. Do you have a blog post or code sample detailing how you do that? I'd like to see that.

Paul Gruffydd
Paul Gruffydd Jun 21, 2019 04:15 PM

I'm afraid I don't have anything written up but, if people would find it useful, I might write up my approach as a blog post. If you're willing to pick through some code, Valdis takes a similar approach in his EPiBootstrapArea project here:

https://github.com/valdisiljuconoks/EPiBootstrapArea/blob/master/src/EPiBootstrapArea/BootstrapAwareContentAreaRenderer.cs

KennyG
KennyG Jun 24, 2019 02:19 PM

Hey Paul, I see you did write it up! Nice!

Jeroen Stemerdink
Jeroen Stemerdink Jun 27, 2019 08:09 AM

For more content related tips, have a look at my post here

Deepa Puranik
Deepa Puranik Jun 28, 2019 06:12 AM

Thanks for this useful checklist.

In which scenario using content area will be fine? Do we need to avoid it throughtout?

Deepa Puranik
Deepa Puranik Jun 28, 2019 06:12 AM

Thanks for this useful checklist.

In which scenario using content area will be fine? Do we need to avoid it throughtout?

Steve Horn
Steve Horn Nov 14, 2019 03:26 PM

This is a useful list. It would be very helpful to include a "why" statement after each suggestion as well as an alternative solution.

Please login to comment.
Latest blogs
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when Iā€™m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language ā€“ Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog