Expand my Community achievements bar.

Permission Check Servlet Performance Issue

Avatar

Community Advisor

We are using session based check to determine if a request should have access to a resource. This is causing massive performance hit on our instance when the load becomes slightly higher (it is relative as we have many sites hosted and have adequate infra for on-prem instance).

We are referring - https://experienceleague.adobe.com/en/docs/experience-manager-dispatcher/using/configuring/permissio...


Performance hit seems to be coming when requests are higher to check the permission and we are using session to check the permission - 

session.checkPermission(uri, Session.ACTION_READ);

Is there a better alternative to this approach without breaking it functionally?

 

thanks.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Level 1
  • Background Job (Scheduler or Event-Driven):

    • Periodically or upon ACL/user changes, calculates which URIs each user (or group) can access.
    • Stores this permission map under "/conf/myapp/permissions/<userId>" as JCR nodes/properties.
  • AuthChecker Servlet:

    • On HEAD requests (from Dispatcher), reads the user’s precomputed allowed URIs from JCR for the requested URI.
    • Approves access if allowed, denies otherwise.
  • Fallback:

    • If no precomputed data exists, optionally fallback to live session.checkPermission to avoid lockout, and rebuild permissions as necessary.