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.
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.
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 methodIMemberManager.AsPublishedMember()
retrieves theMember
fromIMember
using theIMemberService
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 theIMemberService
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.
Hi,
I am in the same situation It is taking time to get member for their extended properties Have you resolved this issue?
/Yasir
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.
is working on a reply...