What happens if multiple users attempt to refresh the cache at the same time?

If I setup a cache and allow if to be refreshed and multiple users come in and perform a refresh at the same time, will those requests stack up on each other and force a refresh of the cache for each request or will only 1 request force the cache to refresh and all others will get served the cache from the first requestor?

1 answer

1 accepted

0 votes
Accepted answer

The cache manager only refreshes the cache when it has expired - so that normally will occur only once. However if a second request for access to the data is made before the refresh is finished, another refresh request will be made. Anytime a user requests a forced refresh, it will be refreshed no matter when it was lasted refreshed. 

Additional questions:

  1. On Confluence restart, cached entries are no longer available (since it is a memory cache).

  2. By default retry, I assume you mean the refresh interval which, but default is 1 day. You can only change that on each macro and set it to a high value to prevent it from being refreshed very often. 

Bob, Thanks so much for the reply. One more quick question for you that you hopefully know the answer to easily. What happens to caches upon a restart of Confluence. Do all of them get re-cached as soon as Confluence is back up and running? Do they rely on the old cache?

Bob, one more question. What is the parameter that we would need to change so that the default retry would be disabled rather than enabled?

Sorry for the delay in re-asking this one Bob. On Question 2, I was more interested in the new retry functionality than the refresh interval. I was able to find out how to make retry disabled by default. What would happen if it was set to true for retry and 5 users attempted to hit the page simultaneously and the cache was the in the process of being refreshed and took quite awhile to refresh. Would the 2, 3, 4, 5th users continue to retry while the first cache was being generated and then eventually get their own cache?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

344 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you