How does Realm cache invalidation works in Keycloak

We are looking into how we can invalidate Realm cache on our local Keycloak instance. Few action steps that have been tried so far are:

  • Create N no. of realms and clients
  • Delete N number of realms

However, this does not seem to invalidate the cache(we think!) since the GET “/realms” endpoint loads pretty quickly (4.2s) than otherwise which usually take > 1minute. We’re dealing with more than 300 realms here.

Any insights on this would be helpful.