Package com.atlassian.jira.config.cache
Class CacheTTLConfiguration
java.lang.Object
com.atlassian.jira.config.cache.CacheTTLConfiguration
Configuration component for cache TTL (Time To Live).
This component reads cache TTL system properties and provides validated
cache settings for caching operations. Each cache consumer has its own
dedicated property key, with a fallback to the default
DEFAULT_CACHE_TTL_MINUTES value.
The TTL is validated to be within the range of
[MIN_CACHE_TTL_MINUTES; MAX_CACHE_TTL_MINUTES]
minutes to prevent cache thrashing (too low) or excessive staleness (too high).
Configuration: Set via system property or in
jira-application.properties. Each cache can be tuned independently:
# Search request cache specific TTL jira.cache.search.request.ttl.minutes=90 # Share permission cache specific TTL jira.cache.share.permission.ttl.minutes=90Or as JVM arguments:
-Djira.cache.search.request.ttl.minutes=90 -Djira.cache.share.permission.ttl.minutes=90
- Since:
- v10.3.19
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new CacheTTLConfiguration by loading and validating the cache TTL from system properties. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the configured search request cache TTL in minutes.intReturns the configured share permission cache TTL in minutes.
-
Constructor Details
-
CacheTTLConfiguration
public CacheTTLConfiguration()Constructs a new CacheTTLConfiguration by loading and validating the cache TTL from system properties.
-
-
Method Details
-
getSearchRequestCacheTTLMinutes
public int getSearchRequestCacheTTLMinutes()Returns the configured search request cache TTL in minutes.- Returns:
- the search request cache TTL in minutes (guaranteed to be within valid range)
-