Copied to clipboard

Flag this post as spam?

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


  • Michael 125 posts 409 karma points
    Aug 29, 2016 @ 07:16
    Michael
    1

    Memory cache refresh

    Hi all,

    Umbraco 7.5.1 with flexible or traditional lb (2 Virtual machines) update only xml file but page load show old page.

    How can I update in-memory cache on my front-end servers?

    not working for me

    Thanks, Mike

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 31, 2016 @ 10:06
    Alex Skrypnyk
    100

    Hi Michael,

    Please add code below to application start event of your application:

        void PageCacheRefresher_CacheUpdated(PageCacheRefresher sender, Umbraco.Core.Cache.CacheRefresherEventArgs e)
        {
            var cacheEnumerator = HttpRuntime.Cache.GetEnumerator();
            while (cacheEnumerator.MoveNext())
            {
                HttpRuntime.Cache.Remove(cacheEnumerator.Key.ToString());
            }
        }
    

    It removes in-memory cache. Do you use CachedPartials on your pages?

    You can remove xml files also by code on page start.

    Thanks,

    Alex

  • Michael 125 posts 409 karma points
    Sep 05, 2016 @ 14:09
    Michael
    0

    Hi Alex,

    It works!

    Thanks, Mike

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Sep 05, 2016 @ 14:10
    Alex Skrypnyk
    0

    Hi Michael,

    Glad to help ! Have a nice day!

    Thanks,

    Alex

  • 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