Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ehcache in a dropwizard project

I am using dropwizard to create a RESTful service. To avoid hammering the database, I am looking for a good caching solution in java. Searching the web lead me to ehcache. I have read the documentation a bit, but currently it is not clear to me how to use ehcache in a dropwizard project.

For instance, where does the configuration file go? I just need something to help me start using the cache.

If this is difficult to integrate, what would be the most suited caching solution for dropwizard project?

like image 218
Erwin Avatar asked Jun 07 '26 13:06

Erwin


1 Answers

If you ultimately want a simpler (than ehcache) cache framework/API, consider using CacheBuidler from guava:

https://code.google.com/p/guava-libraries/wiki/CachesExplained

A typical cache implementation and use requires just a few lines of code and no configuration files.

like image 163
Keith Avatar answered Jun 09 '26 03:06

Keith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!