I am new to caching, and i have a Spring Boot application via atlassian connect, and i`ve noticed that every time that i make some calls to atlassian , i have this cache in my application
"caches": {
"oauth-2-clients": {
"target": "org.springframework.cache.support.NoOpCache"
}
}
and i know that this comes from AtlassianHostRestClients.authenticatedAsHostActor()
cause i found that this method will automatically store user info i cache
https://www.javadoc.io/doc/com.atlassian.connect/atlassian-connect-spring-boot-api/latest/com/atlassian/connect/spring/AtlassianHostRestClients.html
But this is causing errors in my application
My question is how i can disable this caching or delete it
I`ve tried to use @CacheEvict(value=“oauth-2-clients”, allEntries=true) and spring.cache.type=NONE , but none of this worked
1 Like
Hi @AdriianSemotiuk
Welcome to the community.
You should be able to disable Spring caching by setting the spring.cache.type=NONE
in your application.properties
file, or
spring:
cache:
type: NONE
In your application.yml
file.
If this is not working then it could be that the configuration is not loading the setting, try running Spring boot in debug mode so that it will log where it is loading properties from.
Otherwise you can also opt to add a NoOpCacheManager
bean to your Spring bean configuration.
This can be as simple as
import org.springframework.cache.support.NoOpCacheManager;
@Configuration
public class CacheManagerConfiguration {
@Bean
public CacheManager getNoOpCacheManager() {
return new NoOpCacheManager();
}
}
Cheers,
Mark
1 Like
Unfortunately , after adding NoOpCacheManeger it still adds this to cache
"getNoOpCacheManager": {
"caches": {
"oauth-2-clients": {
"target": "org.springframework.cache.support.NoOpCache"
}
}