You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/caching.adoc
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,8 +49,8 @@ If you have not defined a bean of type `CacheManager` or a `CacheResolver` named
49
49
50
50
Additionally, {spring-boot-for-apache-geode}[Spring Boot for Apache Geode] provides {spring-boot-for-apache-geode-docs}#geode-caching-provider[auto-configuration for using Apache Geode as a cache provider].
51
51
52
-
TIP: It is also possible to _force_ a particular cache provider by setting the configprop:spring.cache.type[] property.
53
-
Use this property if you need to <<io#io.caching.provider.none,disable caching altogether>> in certain environments (such as tests).
52
+
TIP: If the `CacheManager` is auto-configured by Spring Boot, it is possible to _force_ a particular cache provider by setting the configprop:spring.cache.type[] property.
53
+
Use this property if you need to <<io#io.caching.provider.none,use no-op caches>> in certain environments (such as tests).
54
54
55
55
TIP: Use the `spring-boot-starter-cache` "`Starter`" to quickly add basic caching dependencies.
56
56
The starter brings in `spring-context-support`.
@@ -269,7 +269,10 @@ This is similar to the way the "real" cache providers behave if you use an undec
269
269
[[io.caching.provider.none]]
270
270
==== None
271
271
When `@EnableCaching` is present in your configuration, a suitable cache configuration is expected as well.
272
-
If you need to disable caching altogether in certain environments, force the cache type to `none` to use a no-op implementation, as shown in the following example:
272
+
If you have a custom `CacheManager`, consider defining it in a separate `@Configuration` class so that you can override it if necessary.
273
+
None uses a no-op implementation that is useful in tests, and slice tests use that by default via `@AutoConfigureCache`.
274
+
275
+
If you need to use a no-op cache rather than the auto-configured cache manager in a certain environment, set the cache type to `none`, as shown in the following example:
0 commit comments