Chapter 9. Improving performance with caching
This chapter covers
- Cache philosophy
- Cache configuration
- Caching strategies
Caching in general has broad meaning. For example, in a traditional web application that contains presentation, service, and data access layers, it could make sense to cache on any or all of those layers. The iBATIS cache focuses on caching results within the persistence layer. As such, it is independent of the service or presentation layers, and is not based on object identity.
In this chapter, we will look at how to configure, optimize, and even extend the iBATIS caching implementations.
IBATIS’s robust and simple caching mechanism is completely configuration based and removes the burden of managing the cache directly. Before we get into when, why, and how to use iBATIS caching, let’s walk through a quick introduction. Listing 9.1 shows a simple cache configuration and a single mapped statement that uses it.