Developer forum

Forum » Templates » troubles with Usermanagement.Group cache

troubles with Usermanagement.Group cache

Peter Leleulya
Reply

I have a razor template on which I loop through a list of UserManagement Users.
I keep getting cached data here.
I've set the page properties to no cache.I've put Dynamicweb.Modules.UserManagement.Group.ClearCache() and Dynamicweb.Content.Page.UpdateFrontendCache() in the page, but still won't get realtime data.

When I look in the backend the data is updated, but my page shows old data, I can F5 as much as I would like ...

Is there a way to force to get new usermanagement data?
 


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Peter

Can you attach a copy of the template?

Thanks, Nicolai

 
Peter Leleulya
Reply

Well, in short it's like below.
I've tried the Dynamicweb.Modules.UserManagement.Group.ClearCache() in VB functions on several places too after I update a user or add or remove one.

(PS: when I specify a specific Group and call ClearCache() on that Group (what I would rather have) I get forced to change it to the global group cache call)

 

Dynamicweb.Modules.UserManagement.Group.ClearCache();           // clear the cached user groups.
Dynamicweb.Content.Page.UpdateFrontendCache();                  // clear the cached permissions on websites and pages

var accessUsers = UserFunctions.GetMyUsers();            // returns a list of Dynamicweb.Modules.UserManagement.User, this list is not changed after adding or removing users (backend is)
if (accessUsers.Any()) {

    <do some stuff>

    foreach (var subAccount in (accessUsers) {

        <print some user values>            // these values are not updated after changing the user from the front-end and after page refresh (backend values do)

    }

    <do some stuff>
}

 
Nicolai Høeg Pedersen
Reply

Hi Peter

And what happens inside  UserFunctions.GetMyUsers();? I Would like all your code so I can see what happens

Thanks, Nicolai

 
Peter Leleulya
Reply

I’m sorry, I completely missed the email notification of your response.
I sent you an email with some files.
I hope this helps you to help me :)

 

You must be logged in to post in the forum