Caching benefits and pitfalls
In general, the caching mechanism is designed to improve the performance of the application. This is particularly true for data that doesn't change often. Reference data is a perfect example. Another example is articles posted on a discussion forum. Of course, if this data ever changes, you would have to implement the capability to invalidate and refresh the cache. It is a general belief that your application should perform reasonably well without caching enabled. However, there are many things you could do to improve the performance and responsiveness of your application, and caching is one of those things.
However, with this added feature come pitfalls. Caching persisted data is not a good idea if the data can be modified by another application, for example, if your application runs alongside a legacy application. Another thing to watch out for is using a second-level cache in a clustered environment. Not all second-level cache implementations support...