how do clear all the internal stored cache?πππ
Java does not have any direct method which can clear all the internally stored cache.
We have a solution which we can use to achieve this,ππβπ
CacheManager class has a method name getCacheNames() returns the name of the cache, and after that we use clear() to clear that cache.
we use this method to achieve our goal to clear all the cache.
CacheManager.getCacheNames().
CacheManager.getCache(cacheName).clear
https://www.javaoneworld.com/2021/06/how-to-clear-cache-in-springboot-java.html
Top comments (1)
Hi there, we encourage authors to share their entire posts here on DEV, rather than mostly pointing to an external link. Doing so helps ensure that readers donβt have to jump around to too many different pages, and it helps focus the conversation right here in the comments section.
If you choose to do so, you also have the option to add a canonical URL directly to your post.