Copied to clipboard

Flag this post as spam?

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


  • Martina R 9 posts 90 karma points
    Jan 07, 2019 @ 15:55
    Martina R
    0

    Advice on implementing a caching strategy in Umbraco:

    Hello everyone I'm an Umbraco Newbie and I'm trying to implement cache on my website.

    Let's say we have a website that specialize in cook recipes. We have hundreds of recipes, better: ~1000 recipes.

    My Umbraco Backoffice looks something like this:

    Recipes:
    A:
        Avocado Breakfast Bowl
        .
        .
        more recipes starting with a A
    B:
        Bar-B-Que Sauce
        .
        .
        more recipes starting with a B
    .
    .
    Z:
        Za'atar chicken thigs
        .
        .
        more recipes starting with a Z
    

    Every page of our website is made of cook recipes filtered in different ways:

    featured cook recipes 
    last cook recipes
    .
    .
    most voted cook recipes
    and so on.
    

    The strategy I'm using at the moment is really basic: I'm using @html.CachedPartial wherever I can (15 seconds caching => https://24days.in/umbraco-cms/2017/the-one-with-performance/performance-boosts-for-umbraco/)

    But since every 10 seconds I need to:

    • Get all the descendants of the Recipes Tree (for later filtering by the various @html.CachedPartial).
    • Rebuild a dropdown with all the cooks that have a recipe published on the site.

    And these objects are used all over the application I would like to leverage the Umbraco Cache to:

    • Cache an object with all the IPublishedContent Recipes
    • Cache an object with all the cooks (as I need to search in every recipe for the cook name so that I can show only cooks that have published recipes) And bust the cache on a backoffice publish event.

    Is this possible? Is this a good idea?

    In the 2016 talk "pushing umbraco to the limit": https://vimeo.com/183622186 @11:30 ~ 14:15

    they talk about implementing a custom CacheRefresher so I guess it can be done. bonus: this should work also in a load balanced application.

    Here is the official doc: https://our.umbraco.com/documentation/reference/cache/ but it's a bit cryptic for me.

    p.s.: In the last days I've read a lot about caching in both Umbraco and .Net and I've amassed a lot of information, as soon as I reorganize it I'm going to add it to this post for future reference.

  • 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.

Please Sign in or register to post replies