Ehcache: Open-Source Java Caching
ehcache.org · checked 15 Oct 2026
Open-source Java caching with in-process, off-heap, disk and clustered deployment options.
How it plugs in
Signal on Caching Software7.1#2 of 27
Ehcache is a free Java cache for application data, database results and web pages. It can keep data in memory, off-heap or on disk, with configurable expiry and eviction. Ehcache 3.11 needs Java 8 or newer and works with JCache, Spring and Hibernate. Self-hosted deployment is available, while enterprise features use commercial licensing.

Review
In a line
Ehcache is an Apache-licensed Java cache that stores frequently used data to improve application speed and reduce database work. It runs inside an application or across clustered nodes.
What it does
Application data, database results and web pages can all be cached. Entries support time-to-live expiry and configurable eviction rules that decide what leaves the cache.
Its storage can span heap, off-heap and disk, including designs using off-heap alone. It supports in-process and mixed in-process/out-of-process setups, with cache capacity reaching terabytes.
CacheLoaderWriter provides read-through loading and write-through persistence callbacks. JTA-managed XA transactions are also available, including two-phase commit and crash recovery.
How it connects
Applications can use the standard JCache interface specified by JSR-107 through Ehcache 3. The project documents Spring Caching and Hibernate second-level cache integration through javax.cache.
A Java API exposes Cache, CacheManager, PersistentCacheManager and user-managed cache interfaces. Configuration can use XML or Java code. Maven and Gradle can add Ehcache 3.11.1 with org.ehcache:ehcache:3.11.1.
Terracotta clustered storage lets application instances use shared cache data. OSGi-compatible bundles use service discovery, and XA/JTA support comes through a separate ehcache-transactions artifact.
Good fit
Ehcache suits teams running Java applications that need local caching, larger off-heap stores or shared cache data across nodes. It can reduce repeated database work while supporting scalable deployments.
Its standard JCache interface can help applications that want a common cache API, while Spring and Hibernate integrations target those frameworks directly.
Watch for
Java 8 or later is required for Ehcache 3.11, which is the final release line planned to support Java 8. The downloads page reports that FOSS Ehcache 2.x is no longer actively maintained.
For XA caches, documentation lists Read-Committed as the sole supported isolation level and identifies Bitronix 2.1.4 as the only tested transaction manager. Older Ehcache web-service documentation says security is disabled by default and needs configuration.
Clustering uses Terracotta storage, while enterprise security, monitoring, fast restart and professional support are part of Terracotta BigMemory Max rather than the free project.
Pricing
The open-source Ehcache project is available at no cost under Apache 2.0, so there is no separate trial period.
The listed Enterprise Ehcache plan is price on request and includes commercial licensing and support with enterprise features. Deployment is self-hosted.
Verdict
Choose Ehcache if you operate Java software and want a self-hosted cache with standard JCache compatibility, several storage tiers or optional clustered sharing. Its free license and Java configuration options suit teams managing their own infrastructure.
Check Java version, transaction requirements and whether you need Terracotta enterprise features before adopting it. Organizations seeking vendor-backed security, monitoring or support should review the commercial offering.
Our take
Ehcache is a practical choice for Java teams that want an open-source cache they can run themselves. It covers common cache targets, multiple storage tiers, expiry rules and standard JCache interfaces, with documented Spring and Hibernate connections. The main checks are operational: Java 8 is the minimum for version 3.11, Ehcache 2.x is not actively maintained, and some transaction and security details have narrow support. Teams needing commercial monitoring, security or professional help should consider the Terracotta enterprise route instead of relying only on the free project.
- Apache 2.0 licensing with no charge for the open-source project
- Supports heap, off-heap and disk storage tiers
- Works with JCache, Spring Caching and Hibernate
- Offers in-process and clustered deployment options
- Provides configurable expiry and eviction policies
- Version 3.11 needs Java 8 or later
- The 2.x branch is no longer actively maintained
- XA caches offer only Read-Committed isolation
- Only Bitronix 2.1.4 is documented as tested
- Enterprise security and support require the commercial offering
- Pick it ifJava applications needing self-hosted caching; Teams using JCache, Spring or Hibernate; Deployments requiring off-heap or clustered caches
- Skip it ifYou need a managed cloud cache rather than self-hosted software; Your transaction setup needs isolation beyond Read-Committed; You require enterprise monitoring and support without commercial licensing
Pricing
The open-source Ehcache project is free under Apache 2.0. Enterprise Ehcache has commercial licensing and support with pricing on request.
- EhcacheOpen source · Apache 2.0 licenseFree
- Ehcache open-sourceApache 2.0 licensed · self-hosted Java cacheFree
- Enterprise EhcacheCommercial licensing and support · enterprise featuresOn request
As ehcache.org lists them, checked 3 Oct 2026.
Questions
Is Ehcache free?
Yes. The open-source Ehcache project is free and licensed under Apache 2.0. An Enterprise Ehcache plan is available at a price on request.
What Java version does Ehcache 3.11 need?
Release 3.11 runs on Java 8 or newer, and this is the last Ehcache line planned to support Java 8.
Does Ehcache support JCache?
Yes. Ehcache 3 works with the JCache API specified by JSR-107, and the project documents Spring Caching and Hibernate integration through javax.cache.
Can Ehcache run as a distributed cache?
Terracotta clustered storage lets cache data be shared across application instances. In-process and mixed in-process/out-of-process deployments are also supported.
How is Ehcache configured?
You can configure Ehcache with XML or its Java API. Maven and Gradle can add version 3.11.1 using org.ehcache:ehcache:3.11.1.
Is Ehcache 2 still maintained?
The downloads page reports that the FOSS Ehcache 2.x line is no longer actively maintained. Ehcache 3.11.1 is the current line listed in the facts.