Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johan 188 posts 380 karma points
    May 16, 2016 @ 14:08
    Johan
    0

    Navigation slowing down web site

    Hi!

    After upgrading to latest version of Umbraco (7.2 -> 7.4) the site got really slow (8-10 seconds per load). Been trying to figure out what is slowing it down and removing the fllowing code made it fast again:

    @using RJP.MultiUrlPicker.Models;
    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    
    @{
        var homepage = Model.Content.AncestorOrSelf(1);
    }
    @if (homepage.HasValue("functionNav"))
    {
        var links = homepage.GetPropertyValue<MultiUrls>("functionNav");
        if (links.Any())
        {
            <ul class="functional-navigation">   
            @foreach (var link in links)
            {
                <li>
                    <a href="@link.Url" title="@link.Name" target="@link.Target">@link.Name</a>
                </li>
            }
            </ul>
        }
    }
    

    I upgraded to the latest version of RJP.MultiUrlPicker (v. 1.3.1) but it didn't help. Is there some weird stuff going on with my code?

  • Steve Morgan 1349 posts 4459 karma points c-trib
    May 16, 2016 @ 14:33
    Steve Morgan
    0

    HI,

    That looks pretty standard to me...

    Just as a test - to take the traversal of the tree out of the equation try (replacing 1234 with your homepage node ID

    @{
    var homepage = Umbraco.TypedContent(1234);
    }
    

    Steve

Please Sign in or register to post replies

Write your reply to:

Draft