> For the complete documentation index, see [llms.txt](https://bohans.gitbook.io/ji-chu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bohans.gitbook.io/ji-chu/mybatis/ji-chu-zhi-shi/mybatis-huan-cun/ji-cheng-wai-bu-huan-cun.md).

# 集成外部缓存

## 集成 EhCache 缓存

**EhCache 是一个纯粹的 Java 进程内的缓存框架**，具有快速、精干等特点。具体来说，EhCache 主要的特性如下：

* 快速。
* 简单。
* 多种缓存策略。
* 缓存数据有内存和磁盘两级，无须担心容量问题。
* 缓存数据会在虚拟机重启的过程中写入磁盘。
* 可以通过 RMI、可插入 API 等方式进行分布式缓存。
* 具有缓存和缓存管理器的侦听接口。
* 支持多缓存管理器实例以及一个实例的多个缓存区域。

MyBatis 项目开发者提供了 EhCache 的 MyBatis 二级缓存实现，该项目名为 ehcache-cache。

## 集成 Redis 缓存

MyBatis 项目开发者提供了 Redis 的 MyBatis 二级缓存实现，该项目名为 redis-cache。
