> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/31.-caching/31.1-supported-cache-providers/31.1.3-ehcache-2.x.md).

# 31.1.3 EhCache 2.x

如果类路径下存在一个名为`ehcache.xml`的文件，则缓存将使用[EhCache](http://www.ehcache.org/) 2.x。如果存在EhCache 2.x，由`spring-boot-starter-cache`“Starter”提供的`EhCacheCacheManager`将用于启动缓存管理器。也可以提供一个替代的配置文件，如下所示：

```
spring.cache.ehcache.config=classpath:config/another-config.xml
```
