Copied to clipboard

Flag this post as spam?

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


  • Naman 20 posts 101 karma points
    Mar 28, 2016 @ 12:33
    Naman
    0

    Support for Caching In Umbraco

    Hi All,

    I was going through Caching concept in Umbraco and find the way to get and set items in Cache using Umbraco.Core.CacheHelper class.

    On deeper analysis of this class i found that almost all the methods of this class are decorated with obselete attribute as follows:-

    [Obsolete("Do not use this method, access the runtime cache from the RuntimeCache property")]

    I am planning to use RunTimeCache property for caching purposes. Is this fine?

    var current = ApplicationContext.Current;

    var cacheHelper = current.ApplicationCache;

    cacheHelper.RuntimeCache

  • Alex Skrypnyk 5758 posts 21868 karma points MVP 4x admin c-trib
    Mar 28, 2016 @ 14:03
    Alex Skrypnyk
    0

    Hi Naman,

    What do you want to store in cache?

    Can you describe type of data, and how this data will be used?

    Thanks, Alex

  • Jeavon Leopold 3005 posts 13193 karma points MVP 7x admin c-trib
    Mar 29, 2016 @ 17:21
    Jeavon Leopold
    0

    Add a using:

    using Umbraco.Core.Cache;
    

    Then use the methods available on

    ApplicationContext.Current.ApplicationCache.RuntimeCache
    

    Everything you need and more!

Please Sign in or register to post replies

Write your reply to:

Draft