A method of caching contextually variant objects in a common cache. The method
can include identifying an object type for a requested object and determining whether
the requested object has an object type which is specified among an enumerated
set of cacheable object types which can be stored in the common cache. Importantly,
each cacheable object type can have an associated context. If the requested object
has an object type which is specified among the enumerated set of cacheable object
types, a cache key can be computed for the requested object using cache key formulation
rules for the associated context. Finally, the requested object can be retrieved
from the common cache using the formulated cache key. Notably, in one aspect of
the invention, the method also can include the step of invalidating individual
objects in the common cache according to corresponding cache policies of associated contexts.