GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aping-fo/caffeine: A high performance caching library for Java 8

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

931 Commits
931 Commits

Folders and files

NameName
Last commit message
Last commit date
caffeine
caffeine
 
 
config
config
 
 
examples
examples
 
 
gradle
gradle
 
 
guava
guava
 
 
jcache
jcache
 
 
simulator
simulator
 
 
wiki
wiki
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
.travis.yml.jdk9
.travis.yml.jdk9
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradle.properties.ci
gradle.properties.ci
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Build Status Coverage Status Maven Central JavaDoc License Stack Overflow

Caffeine is a high performance, near optimal caching library based on Java 8. For more details, see our user's guide and browse the API docs for the latest release.

Cache

Caffeine provides an in-memory cache using a Google Guava inspired API. The improvements draw on our experience designing Guava's cache and ConcurrentLinkedHashMap.

LoadingCache<Key, Graph> graphs = Caffeine.newBuilder()
    .maximumSize(10_000)
    .expireAfterWrite(5, TimeUnit.MINUTES)
    .refreshAfterWrite(1, TimeUnit.MINUTES)
    .build(key -> createExpensiveGraph(key));

Features at a Glance

Caffeine provides flexible construction to create a cache with a combination of the following features:

  • automatic loading of entries into the cache, optionally asynchronously
  • size-based eviction when a maximum is exceeded based on frequency and recency
  • time-based expiration of entries, measured since last access or last write
  • asynchronously refresh when the first stale request for an entry occurs
  • keys automatically wrapped in weak references
  • values automatically wrapped in weak or soft references
  • notification of evicted (or otherwise removed) entries
  • writes propagated to an external resource
  • accumulation of cache access statistics

In addition, Caffeine offers the following extensions:

  • JSR-107 JCache
  • Guava adapters
  • Simulation

Use Caffeine in a community provided integration:

  • Spring Cache (Spring 4.3 & Boot 1.4)
  • ScalaCache: Simple caching in Scala
  • Scaffeine: Scala wrapper for Caffeine
  • Ratpack: Lean & powerful HTTP apps
  • Finagle: Extensible RPC system
  • Druid: Real-time Analytics

In the News

  • A short look at what Caffeine brings to your applications.
    • Add a Boost of Caffeine to Your Java at VOXXED
  • An in-depth description of Caffeine's architecture.
    • Design of a Modern Cache (slides) at HighScalability
  • Caffeine is presented as part of a research paper evaluating its novel eviction policy.
    • TinyLFU: A Highly Efficient Cache Admission Policy by Gil Einziger, Roy Friedman, Ben Manes

On the radar,

  • Early discussions with HBase, Cassandra, and Solr
  • Being adopted in the Neo4j 3.1 and Infinispan 9.0 releases
  • W-TinyLfu implemented by go-tinylfu, mango-cache, and ohc

Download

Download from Maven Central or depend via Gradle:

compile 'com.github.ben-manes.caffeine:caffeine:2.4.0'

// Optional extensions
compile 'com.github.ben-manes.caffeine:guava:2.4.0'
compile 'com.github.ben-manes.caffeine:jcache:2.4.0'

See the release notes for details of the changes.

Snapshots of the development version are available in Sonatype's snapshots repository.

About

A high performance caching library for Java 8

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.