Title
Ehcache
Go Home
Category
Description
Java's most widely used cache.
Address
Phone Number
+1 609-831-2326 (US) | Message me
Site Icon
Ehcache
Tags
More From This Site
Page Views
0
Share
Update Time
2022-05-09 11:27:06

"I love Ehcache"

www.ehcache.org VS gqak.com

2022-05-09 11:27:06

Toggle navigation By About Docs Download Community We Love Contributors Contributing Forums Users' Forum Developers' Forum Source Code GitHub (Ehcache 3) SVN (Ehcache 2) Bug Tracking GitHub (Ehcache 3) Jira (Ehcache 2) JAVA’S MOST WIDELY-USED CACHE Downloads Documentation GitHub Project Ehcache is an open source, standards-based cache that boosts performance, offloads your database, and simplifies scalability. It's the most widely-used Java-based cache because it's robust, proven, full-featured, and integrates with other popular libraries and frameworks. Ehcache scales from in-process caching, all the way to mixed in-process/out-of-process deployments with terabyte-sized caches. Ehcache 3.10 is now available! The major feature in this release is addition of new variant JARs that adopt the Jakarta EE namespaced JTA and JAXB APIs. It requires Java 8+. Watch for continued rapid improvements to features, stability and performance of the 3.x line throughout the coming months! As a reminder, Ehcache 3 introduced the following: Revamped API that leverages Java generics and simplifies Cache interactions, Full compatibility with javax.cache API (JSR-107), Offheap storage capabilities, including offheap only caches, Out of the box Spring Caching and Hibernate integration thanks to the javax.cache support, And many more ... "Official" builds are available on the project's GitHub release page or from Maven Central - see below. Ehcache 3 Quick Start Ehcache 2.x Quick Start Getting started with Ehcache 3 You can introduce caching to your Java application quite easily with Ehcache, either using its new, powerful API or using the javax.cache API as defined in the JSR-107 specification. Using the core Ehcache v3 API Ehcache 3 has a streamlined, modernized type-safe API (and configuration) that will greatly improve your coding experience when compared to Ehcache 2.x. Downloading the jars You can download the jar directly from github or get it from Maven Central: org.ehcache ehcache 3.10.0 Coding to the Ehcache 3 API CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .withCache("preConfigured", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.heap(100)) .build()) .build(true); Cache preConfigured = cacheManager.getCache("preConfigured", Long.class, String.class); Cache myCache = cacheManager.createCache("myCache", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.heap(100)).build()); myCache.put(1L, "da one!"); String value = myCache.get(1L); cacheManager.close(); Using the JSR-107 API Downloading the jars You'll need the Ehcache distribution as mentioned above, you'll also require the actual JSR-107 API: javax.cache cache-api 1.1.0 Not quite ready yet? Read the user documentation for everything you've been wondering about the new API! Getting started with Ehcache 2 You can introduce caching to your Java application quiet easily with Ehcache 2. Using the core Ehcache v2 API Downloading the jars You can download the jar directly from ehcache.org or get it from Maven Central: net.sf.ehcache ehcache 2.10.3 Coding to the Ehcache 2 API // Create a cache manager final CacheManager cacheManager = new CacheManager(); // create the cache called "hello-world" final Cache cache = cacheManager.getCache("hello-world"); // create a key to map the data to final String key = "greeting"; // Create a data element final Element putGreeting = new Element(key, "Hello, World!"); // Put the element into the data store cache.put(putGreeting); // Retrieve the data element final Element getGreeting = cache.get(key); // Print the value System.out.println(getGreeting.getObjectValue()); Not quite ready yet? Read the user documentation for everything you've ever wondered about the Ehcache 2 API! Related Projects: Twitter Facebook LinkedIn GitHub Download Now Documentation Join the Community Ehcache is Open Source and freely available under the Apache 2 License © Terracotta, Inc., a wholly-owned subsidiary of Software AG USA, Inc. All rights reserved.