Copied to clipboard

Flag this post as spam?

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


  • HannesCloudNine 3 posts 23 karma points
    Sep 14, 2022 @ 10:04
    HannesCloudNine
    0

    Member cache in Umbraco dotnet core

    Hello!

    The member cache in Umbraco 9 and 10 seems to be removed since https://github.com/umbraco/Umbraco-CMS/pull/10159#issue-863576350. We realized this as we were working on a Umbraco 9-site where we store additional custom properties on the Member object (for example "Phone" and "Job title"). In order to retrieve these custom properties in a list view of members we need to access the Member object but since the current method IMemberManager.AsPublishedMember() retrieves the Member from IMember using the IMemberService the performance is horrible.

    In the documentation for the AsPublishedMember() here https://our.umbraco.com/documentation/Reference/Querying/IMemberManager/ there is an example of retrieving the member in what seems to be a Razor code block, which I find confusing since it is an anti-pattern to use the IMemberService in Views. But I guess it is manageable with a single member. However, with an entire list of members, this method is not viable.

    Does anyone know what the best course of action would be here? We are currently looking into adding a custom cache layer for the members, but would rather find a better solution.

  • Yasir Butt 161 posts 371 karma points
    Jul 22, 2023 @ 07:56
    Yasir Butt
    0

    Hi,

    I am in the same situation It is taking time to get member for their extended properties Have you resolved this issue?

    /Yasir

  • HannesCloudNine 3 posts 23 karma points
    Aug 09, 2023 @ 07:24
    HannesCloudNine
    0

    Hi,

    We did get around the problem by implementing a custom cache layer of a lightweight version of the member data, with inspirations from the docs (https://docs.umbraco.com/umbraco-cms/reference/cache).

    It works fine for our needs at the moment, but it is not optimal. It would be great to get a recommended approach added to the docs since this seems like a rather common scenario.

Please Sign in or register to post replies

Write your reply to:

Draft