From 1fcd9af4c07a01c2ad462a43ef4422553e65cc38 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 21 Apr 2021 11:16:41 +0200 Subject: [PATCH] Mention RedisCache locking behavior details. Closes: #1801 Original Pull Request: #2051 --- src/main/asciidoc/reference/redis-cache.adoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/asciidoc/reference/redis-cache.adoc b/src/main/asciidoc/reference/redis-cache.adoc index 522b5881b..bd2c5d22f 100644 --- a/src/main/asciidoc/reference/redis-cache.adoc +++ b/src/main/asciidoc/reference/redis-cache.adoc @@ -35,7 +35,11 @@ RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig() .disableCachingNullValues(); ---- -`RedisCacheManager` defaults to a lock-free `RedisCacheWriter` for reading and writing binary values. Lock-free caching improves throughput. The lack of entry locking can lead to overlapping, non-atomic commands for the `putIfAbsent` and `clean` methods, as those require multiple commands to be sent to Redis. The locking counterpart prevents command overlap by setting an explicit lock key and checking against presence of this key, which leads to additional requests and potential command wait times. +`RedisCacheManager` defaults to a lock-free `RedisCacheWriter` for reading and writing binary values. +Lock-free caching improves throughput. +The lack of entry locking can lead to overlapping, non-atomic commands for the `putIfAbsent` and `clean` methods, as those require multiple commands to be sent to Redis. The locking counterpart prevents command overlap by setting an explicit lock key and checking against presence of this key, which leads to additional requests and potential command wait times. + +Locking applies on the *cache level*, not per *cache entry*. It is possible to opt in to the locking behavior as follows: