Class CacheTTLConfiguration

java.lang.Object
com.atlassian.jira.config.cache.CacheTTLConfiguration

@Internal @ThreadSafe public class CacheTTLConfiguration extends Object
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=90
 
Or as JVM arguments:
 -Djira.cache.search.request.ttl.minutes=90
 -Djira.cache.share.permission.ttl.minutes=90
 

Since:
v10.3.19
  • 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)
    • getSharePermissionCacheTTLMinutes

      public int getSharePermissionCacheTTLMinutes()
      Returns the configured share permission cache TTL in minutes.
      Returns:
      the share permission cache TTL in minutes (guaranteed to be within valid range)