More in this section

Forums / General Discussions / SiteMapBase.FlushCache() obsolete in 4.2?

SiteMapBase.FlushCache() obsolete in 4.2?

5 posts, 1 answered
  1. Amir
    Amir avatar
    33 posts
    Registered:
    24 Dec 2010
    12 Aug 2011
    Link to this post
    In the video here: http://www.sitefinity.com/blogs/joshmorales/posts/11-05-26/creating_intra-site_modules_in_sitefinity_4.aspx, at 20:38, it states to use "SiteMapBase.FlushCache();" to clear the cache.  We've implemented a module using this, but now we can't compile as that method no longer exists in 4.2.  I did not see this in the breaking changes documentation.

    Could you please provide the alternative solution to this, and hopefully update the documentation to reflect this breaking change as well. Thank you.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Aug 2011
    Link to this post
    Hello Amir,

    This method is removed as it is not required any more. We have taken a different approach with the refactoring of the site map provider, and now when an item is changed the API sends a notification to invalidate cache dependencies for this particular item only. You do not need to clear the cache manually anymore.

    Regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Amir
    Amir avatar
    33 posts
    Registered:
    24 Dec 2010
    17 Aug 2011
    Link to this post
    Great. Thank you.
  4. Bob
    Bob avatar
    330 posts
    Registered:
    30 Dec 2016
    23 Aug 2011
    Link to this post
    Hello Amir,

    Here some additional information on the subject.

    We removed that method as it encourages bad practice. Since SiteMap nodes are dependent on so many things and flushing the entire cache too often makes it very inefficient. In most cases you should not need to take care of this as Sitefinity places appropriate cache dependencies for every cached node. This way only affected nodes will expire. The appropriate way of adding additional logic for node expiration is with custom cache dependencies.  Unfortunately, working with custom cache dependencies is not documented yet.

    In case you really need to flush the entire sitemap cache you can do it like this:
       SystemManager.GetCacheManager(CacheManagerInstance.SiteMap).Flush();



    Greetings,
    Bob
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  5. Amir
    Amir avatar
    33 posts
    Registered:
    24 Dec 2010
    24 Aug 2011
    Link to this post
    Makes sense.  Thank you.
5 posts, 1 answered