mblanc's posterous

« Back to posts
  • Viewed
    times
June 9, 2011

Non-blocking Asynchronous self populating cache with Ehcache

  • Edit
  • Delete
  • Tags
  • Autopost

Suppose you would like to implement the following algorithm :

  • try to get an element from the cache
  • if the element is not expired
    • serve the value
  • else
    • serve the expired value
    • refresh the element in the background

Ehcache doesn't provide an out-of-the-box solution for this.

Here is an Ehcache decorator that does just that :

  • 0 responses
  • Like
  • Comment