Copied to clipboard

Flag this post as spam?

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


  • Jeric Yuen 334 posts 508 karma points
    Oct 30, 2019 @ 14:08
    Jeric Yuen
    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 31 posts 267 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 :)

  • Jeric Yuen 334 posts 508 karma points
    Oct 30, 2019 @ 14:37
    Jeric Yuen
    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 31 posts 267 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.

  • Jeric Yuen 334 posts 508 karma points
    Oct 30, 2019 @ 14:55
    Jeric Yuen
    0

    Thanks I'll take a look

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

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

  • 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