Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


Expired element better than null return cache

  • bhafer

    Based on requirements of a project I had and several comments I saw on the forums from people inquiring about similar functionality, I created a jar with drop-in enhancements for ehcache 1.7.x at


    - An ExpiredBetterThanNullSelfPopulatingCache that will return an expired entry (instead of null) if it can't obtain an updated one.

    - A SelfRefreshingCache that decorates SelfPopulatingCache and provides a thread to background refresh the cache at a configured interval.

    - A MultiCacheEntryFactoryRouter that allows one cache to be populated by different CacheEntryFactory's depending on the requested key value.

    - Spring integration for the above features.

    Please check it out and let me know on the forums there your feedback.