Copied to clipboard

Flag this post as spam?

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


  • Jay 413 posts 639 karma points
    Oct 30, 2019 @ 14:08
    Jay
    0

    V7 CacheRefresherBase to V8 codes

    Hi All,

    Was wondering how do you do the PageCacheRefresher on the new V8 codes now.

    Back in V7, we used to have something in the ApplicationStartedEvents that calls the below

    CacheRefresherBase<PageCacheRefresher>.CacheUpdated += this.PageCacheRefresherCacheUpdated;
    CacheRefresherBase<MediaCacheRefresher>.CacheUpdated += this.MediaCacheRefresherCacheUpdated;
    

    Thanks

  • Jeffrey Veer 41 posts 308 karma points
    Oct 30, 2019 @ 14:17
    Jeffrey Veer
    0

    Hi JLon,

    I think what you are looking for are Composer/Components, you can register the same event using a Component: https://our.umbraco.com/documentation/implementation/composing/#example---creating-a-component-to-listen-for-contentservicesaving-events

    If you have any questions about the implementation, let me know and I will try to help :)

  • Jay 413 posts 639 karma points
    Oct 30, 2019 @ 14:37
    Jay
    0

    Thanks Jeffrey, been trying out the components now.

    What I wasn't too sure is the PageCacheRefresher no longer exist on V8, which are used as the events handlers for distributed servers.

    Any idea?

  • Jeffrey Veer 41 posts 308 karma points
    Oct 30, 2019 @ 14:49
    Jeffrey Veer
    0

    Hi JLon,

    I'm not sure with what the PageCacheRefresher is replaced, but it seems to not be existing on the V8 repository anymore. Maybe you can have a look at the repository yourself to see which may be applying: https://github.com/umbraco/Umbraco-CMS/tree/v8/dev/src/Umbraco.Web/Cache

    For the MediaCacheRefresher the function is still available:

    CacheRefresherBase<MediaCacheRefresher>.CacheUpdated += this.MediaCacheRefresherCacheUpdated;
    

    Maybe someone else has a bit more experience on this part as well and can guide you in the right directory for the refresher.

  • Jay 413 posts 639 karma points
    Oct 30, 2019 @ 14:55
    Jay
    0

    Thanks I'll take a look

  • Robert Ghafoor 33 posts 95 karma points
    Feb 28, 2020 @ 17:05
    Robert Ghafoor
    0

    Im not 100% on this but i think its replaced with CacheRefresherBase<ContentCacheRefresher>.CacheUpdated

Please Sign in or register to post replies

Write your reply to:

Draft