Summary
Ehcache is a general-purpose Java cache used mainly in J2EE applications and light-weight containers. Ehcache provides memory and disk stores, and version 1.2 offers distributed caching capabilities as well, with multicast-based cache discovery and the ability to plug custom RMI connections into the replication and update mechanism.
Distributed caching. The default implementation supports cache discovery via multicast or manual configuration. Updates are delivered either asynchronously or synchronously via custom RMI connections. Additional discovery or delivery schemes can be plugged in by third parties.
Two new eviction policies: Less Frequently Used (LFU) and First In First Out (FIFO).
Multiple CacheManagers per virtual machine.
ehcache 1.1 was the first open source Java cache to introduce persistent storage of cache data on disk on shutdown. That makes cached data accessible at the next application start. With 1.2, the flushing of entries to disk can be executed with a cache.flush() method whenever required, making it easier to use ehcache. The combination of memory and disk cache stores has proven quite scalable, since the largest ehcache installations use memory and disk stores in the gigabyte range. According to the project documentation, ehcache is tuned for these large sizes.
Significant (up to 7 fold) DiskStore performance increases.
API for Objects in addition to Serializable. Non-serializable Objects can use all parts of ehcache except for DiskStore and replication.
ehcache 1.2 is fully backwards compatible with the 1.1 version, and a new Hibernate cache provider allows Hibernate 3.2 applications to take advantage of the new ehcache features.
With so many excellent caching choices, what are your cache preferences for J2EE apps?
Never used the JBoss cache, but I was up and running with EhCache ready for production in about 2-3 hours. It's a good sign when you aren't even curious about the competition.