Documentation for Crowd 2.2. Documentation for other versions of Crowd is available too.
Caching is used to store run-time authentication and authorisation rules, which can be expensive to calculate.
This page describes the cache that can be configured in each of the Crowd-connected applications, such as JIRA, Confluence and Bamboo. For an overview of the other types of caching offered by Crowd, please refer to Overview of Caching.
Crowd application caching is also referred to as 'client caching'.
On this page:
Crowd-integrated applications can store user, group and role data in a local cache. This helps improve the performance of Crowd since these applications do not have to repeatedly request information from Crowd. Generally, it is not necessary to configure application caching, although this depends on the size of your application deployments.
To enable application caching,
crowd-ehcache.xml
file, which is located in the WEB-INF/classes
directory of your application's Crowd client. The two main properties are:
diskPersistent="true"
) this is the location on the file system where Ehcache will store its caching information. By default it uses java.io.tmpdir
which is Java's default temporary file location. Some applications may enable/disable caching based on the Crowd server setting
The Crowd API allows an application to query whether caching is enabled on the Crowd server (isCacheEnabled
). The Crowd Java client does not make use of this API feature, because it makes more sense to have application caching configured entirely on the application side. If you have a Crowd-integrated custom application which does make use of this API call, then the setting on the Crowd server will affect your application-side caching as well.
Below is a small snippet of the crowd-ehcache.xml
file.
<ehcache> <diskStore path="java.io.tmpdir"/> <defaultCache maxElementsInMemory="50000" eternal="false" overflowToDisk="false" timeToIdleSeconds="300" timeToLiveSeconds="300" diskPersistent="false" diskExpiryThreadIntervalSeconds="120"/> </ehcache>
(Number of users x 2) + (number of groups x 2)
The default maxElementsInMemory value of 50000 should be sufficient for most Crowd-integrated applications. However, for larger installations please ensure that the maxElementsInMemory matches the recommended size calculation listed below:
Name of Cache: |
Size Calculation: |
---|---|
|
The number of users in your system. |
|
The number of groups in your system. |
|
The number of groups in your system. |
|
The number of users multiplied by the number of groups (users * groups). This total could be quite large, so you can optimise it by setting it to the number of users that are likely to be active at any one time. The algorithm will fall back to using the |
|
The number of users in your system. |
|
The number of groups in your system. |