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.

9.1. A simple iBATIS caching example

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.

Listing 9.1. Basic caching example

9.2. iBATIS’s caching philosophy

9.3. Understanding the cache model

9.4. Using tags inside the cache model

9.5. Cache model types

9.6. Determining a caching strategy

9.7. Summary