> 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.9-simple.md).

# 31.1.9 Simple

如果找不到其它提供商，一个使用`ConcurrentHashMap`作为缓存存储的简单实现将被配置。这是应用没有添加缓存库的默认设置。默认地，缓存按需被创建。但是你可以通过设置`cache-names`属性来限制可用的缓存。例如，如果你只想要`cache1`和`cache2`缓存，如下设置`cache-names`属性：

```
spring.cache.cache-names=cache1,cache2
```

如果你这样做了，而你的应用使用了一个没有列举在以上列表中的缓存，那么当需要此缓存时，获取缓存的操作会在运行时失败，而不是在启动时。这和实际的缓存提供商的行为相似，如果你使用了一个没有声明的缓存。
