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
    May 28, 2019 @ 14:57
    Ismail Mayat
    0

    Request cache v runtime cache

    I have an inherited v7.12.3 site. We have some performance issues, one thing we have noticed that will fix performance issues in the caching layer. So we have code:

    private IPublishedContent FindFromCache(string cacheKey, Func<object> find)
        {
    
            // MUST BE DONE PER REQUEST DUE TO THREADING ISSUES
            // Cache for the current request only.
            // Content nodes cannot be cached in the application scope as it causes some issues when the cache is dropped (Suspected threading issues)
    
            return UmbracoContext.Current
                .Application
                .ApplicationCache
                .RequestCache
                .GetCacheItem(cacheKey, find) as IPublishedContent;
        }
    

    This is currently caching by using RequestCache. I have updated to use RunTimeCache instead all works fine and we get performance boost. However this comment left by someone at some point is a bit concerning.

    Can anyone shed light on this? Are there issues with caching in Runtime cache an IPublishedContent item?

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft