Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EhCache: Cache Architecture [closed]

New to caching in general and am enjoying the EhCache (2.4) User's Manual (I couldn't find 2.5).

Right off the bat there are some fundamental concepts that I'm just not finding the answer to anywhere in the manual or their website.

  • Why should there ever be any more than 1 cache for an application? Are cache's like log4j loggers, where each class in your application should get its own logger?
  • Using EhCache lingo, what's the difference between a Cache (<cache>), and an Ehcache (<ehcache>)?
  • Here's a fun one: how do you pronounce EhCache?!? "Ay-cache"? "Ee-cache"?

Thanks in advance!

like image 601
IAmYourFaja Avatar asked May 21 '26 13:05

IAmYourFaja


1 Answers

Different caches for different caching policies. You may want to cache small, static bits of data for a long time, in memory. Where as larger objects may have a shorter lifespan to limit memory overhead, maybe even caching to disk locally if fetching the data takes more time than reading from disk.

I believe EhCache is the interface you should program against, where as Cache happens to be an implementation of EhCache.

For me, I pronounce it E H Cache. Say the letters. By no means an definitive answer. :)

like image 131
rfeak Avatar answered May 26 '26 20:05

rfeak