Book Image

Mastering Spring Application Development

By : Anjana Mankale
Book Image

Mastering Spring Application Development

By: Anjana Mankale

Overview of this book

Table of Contents (19 chapters)
Mastering Spring Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 10. Spring Cache

Spring cache has come into action since the Spring 3.1 versions. Spring has also added annotations to support the caching mechanism. The caching abstraction layer provides a lot of support to use different caching solutions. In this chapter, we shall explore Spring caching. We shall see how to set up a Spring cache. You can ideally tie your caching code with a business logic.

Caching avoids re-computing. Ideally, you don't have to repeat the same process again to fetch the same values. Cache stores the values in the memory. You can always choose what you would like to cache and what you don't like to. It's a part of architectural design. Once the data is cached, it's retrieved from the cached memory, thus saving computational time.