This project is read-only.

Navigation Cache Module Released

Topics: Announcements
Jun 18, 2013 at 7:53 PM
Edited Jun 26, 2013 at 11:15 AM
Trying to speed up your Orchard website?

Rework.NavigationCache developed out of my analysis (using MiniProfiler) of the slowest performance factor on my websites being the navigation. If you have a small website, this may not be an issue for you. However, if you are building a larger website, want to take advantage of breadcrumbs, and just plain want to speed up your site this module may be fore you. On my sites it shaved off more than 2 seconds.

Here is the link where you can grab source code from:

I welcome contributions/suggestions for improvements (and even alternatives to keep Orchard fast).
Jun 26, 2013 at 6:29 AM
This sounds interesting. Do you think that should be integrated into core?
Jun 26, 2013 at 11:25 AM
I have thrown in the link to the codeplex site where the source is hosted as that should have been listed. Regarding core, yes, I think the concept should be integrated into core but the exact code probably not. I need a more creative mind to consider options as, right now, I need to implement a deep clone option to have a full menu copy saved in cache and deep clones are too easily broken / hard to maintain. Apparently, even my deep clone is not quite deep enough as the module needs to grab a "fresh copy" of the menu for the HTML Menu Content Item from the database (otherwise will throw an issue about initiating a new connection, which most host servers don't allow).

Summary: I don't want to belittle the value of the module, I use on all my websites to increase performance and it is fantastic. Just would want to consider additional areas of improvement (which I am sure can be readily done once we are willing to change core). Glad to help in the effort if it is deemed valuable.
Jun 27, 2013 at 1:16 AM
Thanks. You might want to open a bug to track this.
Jun 27, 2013 at 1:47 AM
Why not simply using SysCache ?
Jun 27, 2013 at 3:04 AM
I use both SysCache and Cache but neither of these seem to bring about the results compared to using them in conjunction with the above module for caching navigation menu widgets.

The Cache module works well when the full page is cached but the first time every page loads can still be slow because of the menus. With the module above, the menus are cached across all pages so only the very first page visited is slower. Even then, if another anonymous user has already cached the menu even the first page won't be slow. In addition, the module also allows authenticated users to have their own cached menus so even authenticated users will benefit from using the module (whereas Cache module doesn't have this allowance, for good reasons unless the cache could be customized to the user).

I don't know a lot about SysCache (though as I understand it, it is database level caching using nhibernate caching). It seems it would (and probably does) help a lot by caching the SQL calls to the database. My tests still showed that the navigation system was my slowest point (which is why I implemented the above module).

Would love to hear if SysCache could "do it all" as I am all for improving website performance.
Jun 27, 2013 at 3:06 PM
Bug has been filed at this link
Apr 30, 2014 at 2:21 AM
Great work jao28 - I would recommend it to anyone using menus driven by taxonomies - reduced my page loads by about 10x

This has really helped out.. cheers! Should be part of the core :)
Apr 30, 2014 at 2:56 AM
Awesome @beebul, glad it worked for you. I use it on every website I put up, even if it doesn't have a taxonomy menu, still helps some (but you definitely notice it the most on intense menus). Please upvote the work item: as I would love to see a similar solution in core.
Apr 30, 2014 at 3:16 AM
I wondered if you could assist with a weird issue I'm having.. now I am happy that the speed is up to scratch I am trying to disable the mini-profiler it kills my site. Now I know that this might not be directly related to your module - but it has only happened since I installed it... so...?
Apr 30, 2014 at 3:23 AM
Interesting, I wouldn't think they are related but glad to try and help. I had used the mini-profiler while building out / testing the menu cache and could turn it on and off so they should play nicely. Do you have any errors in your log file? Glad to review them.
May 3, 2014 at 9:21 PM
Set navigation cache up to use the Roles module to reduce number of instances which need cached. Should bump up performance a bit, latest changes found here: