Copied to clipboard

Flag this post as spam?

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


  • billyhomebase 12 posts 20 karma points
    Apr 16, 2009 @ 19:04
    billyhomebase
    0

    Slow looping through media types

    I have a site which contains a list of publications. Due to the way these publications need to appear I have set each one up as a media type.

    These media types are often read and ordered or appear within containing pages.

    I have noticed that the pages which read these media types, especially listing and ordering them, take far longer to render than other pages.

    The 2 questions are:
    1. Is this what you would usually expect to happen?
    2. Is there a way to speed this up?

    The site is here:
    http://www.talentlens.co.uk/develop.aspx

    Regards

    Billy

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Apr 17, 2009 @ 01:16
    Morten Bock
    0

    Is it a V3 site? Earlier versions have had some performance issues with the GetMedia extension method. It seemed to do a lot of DB lookups. This should be better in the new V4.

    Maybe you could try adding caching to your macro?

  • billyhomebase 12 posts 20 karma points
    Apr 17, 2009 @ 10:33
    billyhomebase
    0

    Many thanks.

    I have changed the Macro Cache and it seems better. It is a version 4 site.

    I have the settings as follows:
    Cache Period: 3600 seconds
    Cache by page: Yes
    Cache Personalized: no

    Does that seem about right?

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Apr 17, 2009 @ 12:08
    Ismail Mayat
    0

    Thats a nice looking site! One question take it for publications you have content pages and they reference the publication media item? And you macro is listing the content pages then eventually you can get to pdf?

    It may be that the macro doing the listing can be optimised?

    Regards

    Ismail

  • billyhomebase 12 posts 20 karma points
    Apr 17, 2009 @ 19:26
    billyhomebase
    0

    Thanks for the feedback.

    Yes sort of. The publications are listed under Select, Develop and Engage sections within the site. Because a publication can exist 1, 2 or all of these I have used media types to stop duplication. I have set up a specific media type which has fields like, body copy, title, author, short desceription, publication date etc.

    In heindsight I could have done a work around using a page and then where it was repeated just have a skeleton page pulling the data from the main page. That would have had other issues though I'm sure.

    When you talk about optimising the macro how do you mean. Write better XLS / C# or are these some umbraco specific tips?

    Regards

    Billy

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Apr 20, 2009 @ 09:54
    Ismail Mayat
    0

    billy,

    If you can paste the xslt we may be able to give you some pointers.

    Regards

    Ismail

  • billyhomebase 12 posts 20 karma points
    Apr 20, 2009 @ 10:24
    billyhomebase
    0

    Hi Ismail

    The caching is helping but if you have any more pointers then that would be very helpful. The XLTS below produces the content list on this page:
    http://www.talentlens.co.uk/select.aspx











  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 20, 2009 @ 10:34
    Douglas Robar
    0

    You're making a LOT of calls to GetMedia, which is a slow call. Anything you can do to eliminate such calls will help. Here's one example:

    You currently have this code:[code]<>
    src="{umbraco.library:GetMedia(data [@alias = 'SmallImage']/text(), 'false')/data [@alias = 'umbracoFile']}"
    width="{umbraco.library:GetMedia(data [@alias = 'SmallImage']/text(), 'false')/data [@alias = 'umbracoWidth']}"
    height="{umbraco.library:GetMedia(data [@alias = 'SmallImage']/text(), 'false')/data [@alias = 'umbracoHeight']}"
    alt="{umbraco.library:GetMedia(data [@alias = 'SmallImage']/text(), 'false')/data [@alias = 'AltText']}"
    />[/code]

    You could change this to something like the following, which would save you 3 call for every image:[code]
    <>
    src="{$smImg/data [@alias = 'umbracoFile']}"
    width="{$smImg/data [@alias = 'umbracoWidth']}"
    height="{$smImg/data [@alias = 'umbracoHeight']}"
    alt="{$smImg/data [@alias = 'AltText']}"
    />[/code]

    cheers,
    doug.

  • billyhomebase 12 posts 20 karma points
    Apr 20, 2009 @ 14:10
    billyhomebase
    0

    That makes a lot of sense thank you.

    The more I use Umbraco the more I like it. We are now on our third site build.

Please Sign in or register to post replies

Write your reply to:

Draft