There seems to be automatic caching that happens with MvcSiteMapProvider. Is there a mechanism to disable caching? We have custom caching routines written and I want to run it through those instead of relying on any built in caching mechanism.
Try to call Refresh before render menu or sitemap.
<% var sm = Html.MvcSiteMap();
((MvcSiteMapProvider.DefaultSiteMapProvider)sm.Provider).Refresh(); %>
....
<%: sm.Menu(0, 1) %>
In MvcSiteMapProvider v4, the cache can now be extended or replaced with your own implementation. Have a look at the following blog post that I wrote.
MvcSiteMapProvider 4.0 - Extending the Cache
Under the covers it now uses System.Runtime.Caching.ObjectCache, an abstract class that can be replaced by a cache manager of your choosing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With