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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

359 views 0 6
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