maartenba / MvcSiteMapProvider

An ASP.NET MVC SiteMapProvider implementation for the ASP.NET MVC framework.
Microsoft Public License
539 stars 218 forks source link

Question regarding caching #475

Open noamberda opened 6 years ago

noamberda commented 6 years ago

Hi, We are using MvcSiteMapProvider in MVC5 project. We have static sitemap, mix with Dynamic Nodes that implements IDynamicNodeProvider.

What is the best practice to use caching in this scenario? We noticed that when we turn the cache on the DynamicNodeProviders are not getting called at all. when we turn the cache off by setting MvcSiteMapProvider_CacheDuration=0 we can see performance impact asthe MVC provider keep scanning the dlls for assemblies when creating site maps.

We would like to have the static site map to be cached but the dynamic nodes to be always resolved.

Thanks, Noam

metzing commented 6 years ago

Hi

I suggest using a separate sitemap with the dynamic nodes. Then you can set different cache parameters as described here: https://github.com/maartenba/MvcSiteMapProvider/wiki/Multiple-Sitemaps-in-One-Application#caching