Java cache mechanism

I need to use cache solution in my project.

I’ve used jcs and looks pretty good, but I read that its library is based on jdk1.3 spec.

Ehcache looks another good choice too.

Which library should I use, apache jcs, ehcache or other?


I’ve used EhCache successfully in the past. Very easy to configure and use, provide good performance and easy ways to monitor the content of your cache.

Without telling us more about what exactly you want to cache, it’s difficult to give more details.

You could also consider using some O/RM solution (Hibernate comes to mind) if you need caching between your Java domain objects and your database schema.

Source: stackoverflow