Confluence plugin cache will not reset after configured time exceeded

Aviram Gabay
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.
June 29, 2015

Hi,

Im trying to use the build in caching mechanism in confluence (CacheManager) to cache some processing done is servlets. 
I used the following doc as reference:
https://developer.atlassian.com/confdev/development-resources/confluence-developer-faq/how-do-i-cache-data-in-a-plugin

The problem is that the cache doesn't seem to expire after 30 minutes (or any other time frame  I try to set in the configuration).
Does anyone else encountered this issue? Is this doc up to date?

Im using confluence 5.7.4 I've also spotted this issue in 5.8.4


Cheers,

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Nelson Carranza
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.
July 1, 2015

Hi Aviram,

I had this issue too. At the end I set expireAfterAccess and expireAfterWrite. Clean cache plugins and everything is working as expected.

My cache settings

public CacheSettings getCacheSettings(){
		
		CacheSettingsBuilder cacheSettings = new CacheSettingsBuilder();
		
		cacheSettings.maxEntries(1000)
		.expireAfterAccess(0L, TimeUnit.MILLISECONDS)
		.expireAfterWrite(12, TimeUnit.HOURS)
		.flushable();
		
		return cacheSettings.build();
	}

How to clean cache

https://confluence.atlassian.com/display/CONFKB/How+to+clear+Confluence+plugins+cache

Related link

https://developer.atlassian.com/confdev/development-resources/confluence-architecture/atlassian-cache-2-overview

Regards

Nelson

Aviram Gabay
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.
July 2, 2015

That worked! Brilliant! Thanks! I hope Atlassian will update their docs soon, I can see a lot of people not even aware they have this issue.

Aviram Gabay
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 5, 2015

Hi, got another question... does the cache key has anything to do with the cache aside for storage purposes? meaning, I don't have to use it in the "load" function right? can I just use global set fields of the class instead? Thanks!

0 votes
Aviram Gabay
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.
June 30, 2015

anyone?

TAGS
AUG Leaders

Atlassian Community Events