PREFERENCE_CACHE_EXPIRY_INTERVAL_IN_MINUTE
NUMERIC, number of minutes
The amount of time after which the preference cache, which holds all preference values read from the database, is deemed expired, requiring a reread of the preference values from the database.
The caching is handled by com.mincom.cclas.impl.domain.preference.PreferenceServiceImpl.
The cclas.preference.cache.enabled system property can be set to false to disable preference caching entirely. This is set to true by default.
Whenever preferences are fetched, their result is cached as a batch. This means that fetching the same set of preferences will end up hitting the cache. This was designed to improve the performance of preference-heavy operations like registration or workbook. When fetched, the preferences are cached for the duration specified by the PREFERENCE_CACHE_EXPIRY_INTERVAL_IN_MINUTE preference. This preference is unique in that it only takes effect when configured at the INSTANCE or LABORATORY scopes. By default, the expiry duration is 10 minutes. This can be changed across the entire instance or overridden per laboratory. The interval value must be greater than 0 for caching to take effect. If set to 0, the cache is turned off and values are read immediately from the database. Non-positive values effectively prevent caching, since they expire immediately.
Every 5 minutes, an internal scheduled service (see com.mincom.cclas.impl.domain.preference.PreferenceCacheScheduler) will check whether the expiry interval for a laboratory had been modified. If the value was changed, the preference caches for that laboratory will be invalidated and cleared immediately, rather than waiting for their natural expiry. Indirectly, this allows caches to be invalidated within 5 minutes just by modifying the interval.
There is also a Clear Cache button on CCPREF search page that will invalidate all preferences caches immediately, regardless of the interval duration. This flow action will invoke the clearCache() operation on the CCPreferenceService.
Note: When the environment uses multiple servers with load balancing, the Clear Cache button will only affect the one server that was serving the user, since the cache is just a static map and thus tied to each JVM. The other application servers will continue with the natural expiry of their preference caches. This mechanism was aimed at making it convenient to easily test configuration changes.
