It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence plugin cache will not reset after configured time exceeded

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

1 vote
Answer accepted

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

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.

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!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published yesterday in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

65 views 0 9
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