Note that there are some explanatory texts on larger screens.

plurals
  1. POLightweight Java Object cache API
    text
    copied!<h2>Question</h2> <p>I'm looking for a Java in-memory object caching API. Any recommendations? What solutions have you used in the past?</p> <h2>Current</h2> <p>Right now, I'm just using a Map:</p> <pre><code>Map cache = new HashMap&lt;String, Object&gt;(); cache.put("key", value); </code></pre> <h2>Requirements</h2> <p>I need to extend the cache to include basic features like:</p> <ul> <li>Max size</li> <li>Time to live</li> </ul> <p>However, I don't need more sophisticated features like:</p> <ul> <li>Access from multiple processes (caching server)</li> <li>Persistence (to disk)</li> </ul> <h2>Suggestions</h2> <p>In-Memory caching:</p> <ul> <li><a href="http://guava-libraries.googlecode.com" rel="nofollow noreferrer">Guava</a> CacheBuilder - active development. See this <a href="https://github.com/liubo404/it-ebooks/blob/master/pdf/JavaCachingwithGuava.pdf" rel="nofollow noreferrer">presentation</a>.</li> <li><a href="http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/LRUMap.html" rel="nofollow noreferrer">LRUMap</a> - Config via API. No TTL. Not purpose built for caching.</li> <li><a href="http://whirlycache.dev.java.net/" rel="nofollow noreferrer">whirlycache</a> - XML config. Mailing list. Last updated 2006.</li> <li><a href="http://cache4j.sourceforge.net/" rel="nofollow noreferrer">cache4j</a> - XML config. Documentation in Russian. Last updated 2006.</li> </ul> <p>Enterprise caching:</p> <ul> <li><a href="http://jakarta.apache.org/jcs" rel="nofollow noreferrer">JCS</a> - Properties config. Extensive documentation.</li> <li><a href="http://ehcache.sourceforge.net" rel="nofollow noreferrer">Ehcache</a> - XML config. Extensive documentation. By far the most popular according to Google hits.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload