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
Community showcase
Posted in Jira

We want to hear from you! How do you use Slack and Atlassian together?

Hi Everyone! My name is Mina and I am on Atlassian’s Ecosystems Marketing team. Our team is focused on our technology partnerships and marketplace apps. One of Atlassian’s partners is Slack, who ...

23 views 0 2
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you