文章永久连接:https://tech.souyunku.com/8314
ActiveRecord 可以使用缓存以大大提高性能,以下代码是 Cache 使用示例:
public void list() {
ListblogList = Blog. dao.findByCache(“cacheName”, “key”, “select * from blog”);
setAttr(“blogList”, blogList).render(“list.html”);
}
上例 findByCache 方 法 中 的 cacheName 需 要 在 ehcache.xml 中配置 如: