I have read for larger sites each page view loops through all pages and could slow page rendering. Also, have logic in controller and only render data in view.
While it is true, that looping through all of the pages could slow your site down, one thing we have done in the past is cache the results so that you only need to loop through the site when the cache is dirty (you can catch content save events to mark it as dirty), or when the site starts up.
We are using caching all the time, it's really amazing thing for navigation and stuff like that, Umbraco CachedPartial helper is really useful. So we don't use pure MVC controllers for navigation.
Create local navigation with custom controllers, Model & View
Hi Umbraco Team
I would like to create local navigation via C# MVC framework instead of using OOTB Razor sytnax in Umbraco views.
Not upto speed with MVC, could someone advise/hint how to go about creating navigation viaMVC ?
Thanks Dibs
Hi Dibs
What wrong with Umbraco way of doing navigation?
You can do the same via MVC, just create a model with navigation data, a surface controller for filling the model and view for rendering.
Thanks,
Alex
Hi Alex
I have read for larger sites each page view loops through all pages and could slow page rendering. Also, have logic in controller and only render data in view.
Dibs
Hi Alex,
While it is true, that looping through all of the pages could slow your site down, one thing we have done in the past is cache the results so that you only need to loop through the site when the cache is dirty (you can catch content save events to mark it as dirty), or when the site starts up.
Hi John and Dibs
We are using caching all the time, it's really amazing thing for navigation and stuff like that, Umbraco CachedPartial helper is really useful. So we don't use pure MVC controllers for navigation.
Thanks,
Alex
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion