Copied to clipboard

Flag this post as spam?

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


  • Jorge 37 posts 119 karma points
    Sep 23, 2016 @ 16:37
    Jorge
    0

    Umbraco XML cache how to see it?

    Hi there,

    I was given an existing Umbraco project wherein I saw almost codes are being cache, but I only know bit regarding caching.

    On the project it has a class named "CacheManager" and full of methods with "ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem", ".RequestCache", and any kinds of cache.

    Now I wonder how can I see these caches, specially the keys because I saw this code:

    public static T GetCacheItem<T>(string cacheKey)
    {
        return ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem<T>(cacheKey);
    }
    

    Is there any way I can see the list of cacheKey and its corresponding values? so I know what cacheKey to get? Thanks in advance.

  • Jorge 37 posts 119 karma points
    Sep 24, 2016 @ 11:33
    Jorge
    0

    anyone?

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Sep 24, 2016 @ 11:52
    Nik
    0

    Hi Jorge,

    I'm sorry, I don't fully understand your question. Are you asking if you can see what is in the XML cache? If so, you simply need to open the Umbraco.xml file under App_Data. This contains your published items cache that Umbraco predominantly uses.

  • Jorge 37 posts 119 karma points
    Sep 24, 2016 @ 15:56
    Jorge
    0

    Not the xml, I want to see the internal cache, and if its possible to see it.

  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Sep 25, 2016 @ 14:48
    Alex Skrypnyk
    0

    Hi Jorge,

    Maybe this code will help you:

    foreach (var item in ApplicationContext.Current.ApplicationCache.RuntimeCache.ToDictionary())
        {
            @item.Key
        }
    

    Thanks,

    Alex

  • Marcin Zajkowski 112 posts 585 karma points MVP 7x c-trib
    Sep 25, 2016 @ 22:39
    Marcin Zajkowski
    0

    You can use Glimpse (free, open-source → http://getglimpse.com/). It has Cache Tab which is showing the content of RuntimeCache (+ lot of other useful features helping to diagnose an app).

Please Sign in or register to post replies

Write your reply to:

Draft