Описание тега spring-cache
Spring cache provides a Cache and CacheManager abstraction with several implementations including support for ehcache and JSR-107 providers. It also applies caching to Java methods, reducing thus the number of executions based on the information available in the cache. Both declarative annotation-based caching and aspect-oriented caching are supported.
Spring Framework provides support for transparently adding caching into an existing Spring application. Similar to the transaction support, the caching abstraction allows consistent use of various caching solutions with minimal impact on the code.
To use the cache abstraction, the developer needs to take care of two aspects:
- caching declaration - identify the methods that need to be cached and their policy
- cache configuration - the backing cache where the data is stored and read from
Cache configuration
Spring provides provides several storages integration. To use them, one needs to simply declare an appropriate CacheManager
- an entity that controls and manages Caches and can be used to retrieve these for storage.
Support for simple in-memory map, ehcache, guava and JSR-107 compliant caches are available out of the box.