开发者

Ehcache or varnish or both?

should one use ehcache in favor of varnish? or the other way a开发者_如何学Cround? or both?


On some projects I use both. EHCache is perfect for intermediary results of any type (rescaled images, query results, transformed data) used by your servers. You have to adapt your software to use it though. Varnish is a transparant add-on layer for HTTP-level result caching. If you would use EHCache to cache HTTP end-results, it's a lot of work to get your implementation behave correctly according to the HTTP protocol cache behavior, you have to devise some invalidation/purging/debugging solution, avoid cache-rushes, and implemented in synchronous Servlet technology (e.g. Filter or Servlet) it won't scale as well as Varnish...

So, I would recommend Varnish for HTTP-result caching, and EHCache for intermediary, in-app result caching.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜