Question
I'm looking for a Java in-memory object caching API. Any recommendations? What solutions have you used in the past?
Current
Right now, I'm just using a Map:
Map cache = new HashMap<String, Object>();
cache.put("key", value);
Requirements
I need to extend the cache to include basic features like:
- Max size
- Time to live
However, I don't need more sophisticated features like:
- Access from multiple processes (caching server)
- Persistence (to disk)
Suggestions
In-Memory caching:
- LRUMap - Config via API. No TTL. Not purpose built for caching.
- whirlycache - XML config. Mailing list. Last updated 2006.
- cache4j - XML config. Documentation in Russian. Last updated 2006.
Enterprise caching: