Home | 2.1.1 How caches work | Cache hits and misses


Cache identifiers

In simple terms, a caching service stores and retrieves objects from high-speed devices such as memory or hard disk. In order to be able to quickly retrieve the object, the caching system annotates each cached entry with a unique identifying string called a cache identifier or a cache-id. The cache-id is then stored in an index. Cache identifiers are like primary keys in a database, where the cache-id "key" is composed from one or more parts of the data being cached.

A common technique for producing a cache key is to use a hashing algorithm, where an algorithm is executed against the data and a key is produced. The Java Hash Map (java.util.HashMap) utility used for storing and retrieving Java objects is based on this concept.

In the Web world, caches often follow user-defined rules on how to construct cache-ids from information associated with an application server request (to execute a servlet, JSP, or Java command).

+

Search Tips   |   Advanced Search