Cache FAQ


Table of contents



What is the impact of the cache on Jira performance?

When you activate the cache in a Connect field, this consumes memory on the Jira server. This might affect the available memory, so it's important to keep an eye on it.

If you notice that the cache is using too much memory, you can disable it in some Connect fields.



Is the cache shared between all views (Edit/Display/Search views)?

The cache is query-based. So yes, the cache is shared between all the views of the same Connect field (Edit, Display and Search views), as long as each view uses the same query. 

When the Display or Search view is not configured, it automatically inherits the Edit view configuration.



Is the cache shared between fields?

No, each field has its own cache, so two fields executing the same query will use two separate caches.



Does it make sense to use the cache with $userInput? 

As a reminder, $userInput can be used to retrieve what the user is typing into the field in order to apply a filter to the query and limit the results to be returned, such as:

SELECT * FROM users WHERE username like '$userInput'

In this case, does each character typed into the field trigger a different query to be cached?
Could this result in a large number of cached results that could saturate Jira's memory?

→ Our program smartly manages typing latency to execute the query only after the user has stopped typing, ensuring that only relevant results are stored in the cache. This approach prevents unnecessary queries from being cached, avoiding the overuse of Jira's memory resources.



Is it possible to clear the cache before it expires?

You can clear the cache manually before it expires by doing the following.

  1. Edit the Connect field
  2. Disable the cache
  3. Save
  4. Edit the Connect field
  5. Re-enable the cache
  6. Save



Is the cache automatically refreshed once it has expired?

No, the cache doesn't refresh on its own after it expires.
It gets updated only when the query is run the next time, which happens when you make changes to a Connect field or when you're looking at a value in a Jira issue.



Why is the cache not efficient in some fields?

The cache is query-based. For a given query, a corresponding dataset is stored in memory.

The cache is fully effective when the query has no dependencies and uses no variables, and will be less effective if:

  • Your query depends on variables that change frequently (with a different value for each issue)
  • Your query depends on too many variables 

Let's take the following query as an example:

In this case, the value returned by the $issue.reporter may change, causing the dataset to change, and each of them will be cached separately:



When a cache has expired, is it possible to refresh it automatically at a scheduled time?

Our app does not provide any functionality for doing this.

However, if the Connect field query has no dependency, there is a workaround with Automation for Jira:





This will update the Connect field in the issues where the Automation rule is executed. If you want to avoid this, you can run this rule only in a "fake" issue created for this purpose.



How can I ensure that the cache is working?

This can be observed in the Jira logs, by increasing the logging level of our app to "TRACE", as explained here: How to configure specific Jira logging level for Elements Connect ? - Elements Connect for Jira Server/Data Center

These logs will then be generated in the "atlassian-jira.log" files:

  • When the cache is renewed because it has expired:
    No entry in cache [Field: 'customfield_10112' - Query: '[SELECT * FROM jiraissue]']
    Cache data is obsolete, fetching from datasource directly for Elements Connect Field #1(customfield_10112)
    Query evaluation message: INFO - Getting datasource value. Result will be stored in cache.
    Query executed for field customfield_10112: SELECT * FROM jiraissue
    Data fetched for Elements Connect Field #1(customfield_10112)
    Value added to cache [Field: 'customfield_10112' - Query: '[SELECT * FROM jiraissue]'] for 600 seconds
    Cache entry updated for Elements Connect Field #1(customfield_10112)
  • When the cache is activated and still valid:
    Get data from cache [Field: 'customfield_10112' - Query: '[SELECT * FROM jiraissue]']
    Cache data is still valid
    Query evaluation message: INFO - Returning cached value