Search code examples
javacachingguava

Use Guava Cache to persist data to a hard disk


I am new to Guava Cache. How do I create the following in the cache?

  1. Save the data in memory as normal.
  2. When the size of the cache is over the given number, it will persist the data in cache in a configurable file on the hard disk.

Solution

  • This will probably be helpful: Extending Guava caches to overflow to disk