Optimizing Sitefinity NavigationView Performance

sitefinity | 2024-07-20

In our previous NavigationView implementation, we used PageManager to retrieve a full list of PageNodes in order to get page details and custom fields.

However, this approach caused performance hiccups.
After discussing the issue with Sitefinity Support experts, they recommended an enhanced solution.


💡 Recommended Approach

Instead of using PageManager, it is better to use the SiteMapBase class from the Telerik.Sitefinity.Base namespace.

Why SiteMapBase?

  • It retrieves only the necessary page data, avoiding redundant information.
  • It reduces database load significantly compared to PageManager.
  • It offers faster and more scalable navigation generation, especially for websites with a large number of pages.

The Sitefinity experts confirmed that using the SiteMap API is the preferred method for getting page nodes efficiently.

🛠️ Code Sample

You can find working examples and snippet references here:

  • Navigation.cshtml — Basic snippet structure
  • NavigationView.Horizontal.cshtml — Example based on Sitefinity OOTB NavigationView logic

👉 Full snippets and examples are available at the link below.

📦📚 Repository and References