Open Closed

refresh permissions cache after update permissions without restarting project #6051


User avatar
0
hayash created

i have a problem when i update permissions for specific user or role the permissions cache does not refresh i want a solution to refresh cache without restarting project. :) my project contains main application and group of modules.


4 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi

    please check https://github.com/abpframework/abp/issues/1678 and https://stackoverflow.com/questions/49769936/refresh-permissions-from-in-memory-cache-with-asp-net-boilerplate check if found helpful for you.

    Regards, Anjali

  • User Avatar
    0
    hayash created

    i try to use ICacheManager but does not contain this function => GetUserPermissionCache and i put

    Configure(options => { options.GlobalCacheEntryOptions = new DistributedCacheEntryOptions() { AbsoluteExpiration = DateTimeOffset.UtcNow.Addseconds(60)//60 second };

        });
    

    it's work but the project has become very slow can you help me :(

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello hayash,

    The project is slow because you are configuring the permissions cache to expire every 60 seconds. This means that the permissions cache will be refreshed every 60 seconds, which can be a lot of work for the server.

    To speed up the project try to Increase the time between cache refreshes. For example, you could configure the permissions cache to expire every 300 seconds instead of 60 seconds.

    Regards,

  • User Avatar
    0
    hayash created

    Hello Anjali_Musmade

    yes it's right ,Thank you so much for your response :)

    Regards.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35