The timeout of the GeneXus Access Manager cache, which stores information of the GAM Repository, GAM Applications, GAM Permissions and GAM Events subscription data, is configured in the application server to improve performance. In this way, there's no need to query the database every time the information is needed. While the Cache does not expire, the information is managed in the server memory.
The information stored in Cache is as follows:
- Repository data, for example, UserIdentification (name, email, or both).
- Repository Authentication Types data.
- The connection.gam file information.
- Applications data (the general information, Client Application Data, Remote Authentication and Environment Settings)
- Permissions of the applications in the repository.
- Role Permissions of each application in the repository.
- User Permissions of each application in the repository.
- EventSubscriptions data.
The purpose of this property is to avoid querying the database every time the repository information is needed.
The cache information is reset every time the data is updated. For example, if a permission is associated with a role, this cache information is automatically updated. So, the information retrieved is always updated.
&GAMRepository.CacheTimeout = &RepositoryCacheTimeout (minutes)
0: The GAM cache never expires.
In load balancing architectures, it's necessary to adjust the Cache Timeout property so that all the nodes have coherence in the information used for the repository. If you need to change any repository settings in a clustered environment, you may need to clean the cache for the changes to take effect in all nodes.
When the following lines of code are executed, the Repository cache is forced to clear:
&Repository.Load(&Id) //&Repository is GAMRepository data type. Load the current Repository.
When the Repository settings are changed, using GAM API or just using the GAM Examples of GAM Web Backoffice, the Repository cache of the web server is cleared. Consider that you need to update the repository settings in all the nodes of the cluster.
Use the ClearCache method of GAMRepository object to force the cache clear in every web app where you run the code.
Since GeneXus 15 upgrade 7, this method clears all the cache (not only the repository cache).