From 3d0b682f0f82ab91d28a1c6f1d0be6a7d65066f7 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 23 May 2016 07:09:06 +0200 Subject: [PATCH] Document `none` cache type Closes gh-6004 --- .../main/asciidoc/spring-boot-features.adoc | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 0e43956e8a..43d8b4ae03 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -3574,8 +3574,9 @@ providers (in this order): * <> * <> -It is also possible to _force_ the cache provider to use via the `spring.cache.type` -property. +TIP: It is also possible to _force_ the cache provider to use via the `spring.cache.type` +property. Use this property if you need to <> in certain environment (e.g. tests). If the `CacheManager` is auto-configured by Spring Boot, you can further tune its configuration before it is fully initialized by exposing a bean implementing the @@ -3595,11 +3596,11 @@ configuration before it is fully initialized by exposing a bean implementing the ---- [NOTE] -=== +==== In the example above, a `ConcurrentMapCacheManager` is expected to be configured. If that is not the case, the customizer won't be invoked at all. You can have as many customizers as you want and you can also order them as usual using `@Order` or `Ordered`. -=== +==== @@ -3813,6 +3814,19 @@ your application. +[[boot-features-caching-provider-none]] +==== None +When `@EnableCaching` is present in your configuration, a suitable cache configuration +is expected as well. If you need to disable caching altogether in certain environments, +force the cache type to `none` to use a no-op implementation: + +[source,properties,indent=0] +---- + spring.cache.cache.type=none +---- + + + [[boot-features-messaging]] == Messaging The Spring Framework provides extensive support for integrating with messaging systems: