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

James Roberts August 21, 2015

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
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2015

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. 

James Roberts August 22, 2015

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?

James Roberts August 22, 2015

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?

James Roberts September 11, 2015

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
TAGS
AUG Leaders

Atlassian Community Events