Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Cache Keycloak roles for one minute #2329

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mnonnenmacher
Copy link
Contributor

Requesting the user roles from Keycloak can take some time, slowing down endpoint which would otherwise respond very fast. For example, it was observed in a setup with Keycloak 24 that the Keycloak role requests took between 500-1000ms while the remaining request takes <50ms.

This slows down the UI, especially on pages like the repository list, where a single page makes a lot of API requests.

To mitigate the issue, cache Keycloak roles for one minute. This speeds up such UI pages while at the same time ensuring that changes in the Keycloak roles are quickly reflected by the UI.

Requesting the user roles from Keycloak can take some time, slowing down
endpoint which would otherwise respond very fast. For example, it was
observed in a setup with Keycloak 24 that the Keycloak role requests
took between 500-1000ms while the remaining request takes <50ms.

This slows down the UI, especially on pages like the repository list,
where a single page makes a lot of API requests.

To mitigate the issue, cache Keycloak roles for one minute. This speeds
up such UI pages while at the same time ensuring that changes in the
Keycloak roles are quickly reflected by the UI.

Signed-off-by: Martin Nonnenmacher <[email protected]>
@mnonnenmacher
Copy link
Contributor Author

I did some tests and the duration for requesting the last run for each repository on the repositories page goes down from 500-1200ms to 45-250ms in a setup with a lot of Keycloak roles and Keycloak 24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant