The cache repository is where the actual objects are saved. Spring supports two types of repositories:
ConcurrentMap is also an option for implementing caching in the application. The repository has little (if any) effect on the code, and switching between repositories should be very easy. Our objects will be cached within a ConcurrentMap.
We can configure the ConcurrentMap as shown in the following code:
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> <property name="caches"> <set> <bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="task" /> </set> </property> </bean>
This cache is used by a lot of popular frameworks ...