Hi All,
tl;dr: How to use atlassian-cache/appears to not be working
I am using Scriptrunner in Confluence to create a macro that performs a GET REST call. Depending on the request, the response can take multiple seconds. To handle these requests, I am considering to use caching.
Following this post here, I learned about the altassian-caching API. However, as was mentioned in the post, it appears as if the values I wish to cache are not cached as expected. What appears to be happening on each refresh of the confluence page where my macro resides (as well as via the script console), is that the cache is empty, then the data is stored in the cache, but doesn't persist.
For reference, I am attaching two screen shots. The first screen shot (script-console.png), at the bottom under "logs", I see that the first log ("before") is empty, and the second ("after") contains a value. This is the case on every run despite the cache being initialized with a 30 min expiration.
The second screen shot (script-editor.png), shows the cache initialization (line 28), and lines 55, 57 show the lines that printed the logs from the first screen shot.
Just to reiterate, the same logs are seen on atlassian-confluence.log when refreshing the confluence page where the macro resides. Is this to be expected? How can I have the cache remain persistent (have the "before" log not be empty)?
Thank you,
Erik Macias
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.