Ehcache 1.5.0 User Guide - Cache Configuration 缓存配置(1)

  Ehcache 1.5.0 User Guide - Cache Configuration 缓存配置(1)

Ehcache 1.5.0 用户指南)

E_mail:jianglike18@163.con

Blog: http://blog.csdn.net/jianglike18

qq:29396597

6Cache Configuration (缓存配置)

Caches can be configured in ehcache either declaratively, in xml, or by creating them programmatically and specifying their parameters in the constructor.

While both approaches are fully supported it is generally a good idea to separate the cache configuration from runtime use. There are also these benefits:

  • It is easy if you have all of your configuration in one place. Caches consume memory, and disk space. They need to be carefully tuned. You can see the total effect in a configuration file. You could do this code, but it would not as visible.
  • Cache configuration can be changed at deployment time.
  • Configuration errors can be checked for at start-up, rather than causing a runtime error.

(在ehcache中,缓存可以在xml中配置,或者由程序创建并在构造函数中设置他们的参数

虽然两种方法都完全支持,但是将缓存的配置和运行时使用分开一般比较好,有如下好处:

l        如果让你所有的配置在一个地方比较方便。缓存消耗内存和磁盘空间。他们需要仔细调整。在配置文件中你可以看到的总体影响。用代码你可以做到这一点,但它不会成为可见。

l        缓存的配置可以在部署的时候更改。

l       

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值