Aperto Chiuso

refresh permissions cache after update permissions without restarting project #6051


User avatar
0
hayash creato

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 risposte
  • User Avatar
    0
    Anjali_Musmade creato
    Team di supporto 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 creato

    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 creato
    Team di supporto 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 creato

    Hello Anjali_Musmade

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

    Regards.

Made with ❤️ on ABP v8.2.0-preview Updated on marzo 25, 2024, 15:11