Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jun 13, 2014 @ 11:41
    Ismail Mayat
    0

    Donut caching question

    Guys,

    Here is my situation, i have multi lingual site, each site has its own home node and host name set e.g,

    Home - GB 

    Home - FR

    Home - US

    you get the picture. Each home node has a product carousel set, i have controller that gets that carousel, so I was thinking of doing 

    [DonutOutputCache(Duration = 86400, Location = OutputCacheLocation.Server, VaryByCustom = "url")]

    on the controller, so given that each site has its own url it should cache for each site?.  Further to this to clear the cache I am going to implement events for published event for home node, so if page being published is home node then i am going to clear cache thus,

                    var cacheManager = new OutputCacheManager();
                    //todo check which doc type being published then clear cache
                    cacheManager.RemoveItems("ProductSurface", "ListProductCarousel");

    is it possible to further refine this clear so that i only clear the cache for the current language version? In the event i know which page i am publishing so is there something here that can be done to further refine the clear?

    Regards


    Ismail

  • Chris Gaskell 59 posts 142 karma points
    Jun 19, 2014 @ 16:44
    Chris Gaskell
    1

    Hey Ismail,

    I'm afraid I havent time to look bur you will be able to pull from the cache the exact variant you talk of and just trash that. You're starting to get pretty specialised though, unless you have something on that page that is taking a long time to render I wouldnt risk adding such low level code.

    Another option is you could drop the duration and implement a custom cache key via varybycustom. Then from within that static manager you could control the key values by whatever you like. This would mean that your variants stick in the cache until they naturally expire (hence dropping from a day would help your servers RAM).

     

    HTH

    Chris

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jun 19, 2014 @ 16:58
    Ismail Mayat
    0

    Chris,

    I have seen the by url that Jeavon and Jeroen have in hybrid framework I did give that a go but did not see any speed improvement so i suspect it did not end up in the cache.  Will revisit this when i get a chance.

    Cheers

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft