Copied to clipboard

Flag this post as spam?

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


  • alimac 182 posts 371 karma points
    Apr 22, 2017 @ 21:39
    alimac
    1

    When does the umbraco cache rebuild after member creation?

    So I'm creating a new member programmatically using MembershipHelper.CreateRegistrationModel(). This works fine and I can create the new member. I then use MemberService.GetByUsername() to retrieve my newly created member, populate the relevant extra properties and use MemberService.Save(member) to save the updated member.

    This all works fine, but immediately after creation I try to retrieve the new member using MembershipHelper.GetById(). This returns an IPublishedContent object however I'm guessing at this point the cache hasn't been updated, as all the model properties are empty.

    However this got me thinking: When is the cache updated? Because when I make a web api call immediately after the above statements are finished, the IPublishedContent object is populated.. so somewhere in between the cache got updated and I can't figure out where..

    Can anybody help here?

Please Sign in or register to post replies

Write your reply to:

Draft