Thursday 6 October 2011

something about dynacache..

Caching helps in quick turnaround on pages that donot change that often, the details are either stored in memory or database. Caching happens or can be configured at different places within a web application. Dyanacache provides caching services from the application server. Cache hits and miss, cache item dependancies and cache invalidation are some of the key concepts to understand in caching.

Cache hits and miss is about the caching filter serving the client its request based on its availability in cache db. Cache invalidation is about clearing out the cache db as required and when clearing out taking care of clearing only the relevant data like for instance if an order is cached in check out process and when the order item in an order is changed or removed it is necessary to change the relevant details, this is addressed by cache dependancies wherein a dependancy id of each cache object is maintained in the cache db and during invalidation only the relevand details are invalidated using dependancy ids.

We define caching specification of an application in cachespec.xml. This file contains caching definition and rules. It is a websphere policy file where we define:

1. what is going to be cached (servlets, jsp, commands etc.,)
2. where it is going to be cached (memory or disk)
3. when cache items are evicted (invalidation)
4. how cache entries are related (dependancies)

This file has to be saved in WEB-INF of the web module.

No comments:

Post a Comment