Skip to content

Commit 1fcd9af

Browse files
mp911dechristophstrobl
authored andcommitted
Mention RedisCache locking behavior details.
Closes: #1801 Original Pull Request: #2051
1 parent 1a290c3 commit 1fcd9af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/asciidoc/reference/redis-cache.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
3535
.disableCachingNullValues();
3636
----
3737

38-
`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.
38+
`RedisCacheManager` defaults to a lock-free `RedisCacheWriter` for reading and writing binary values.
39+
Lock-free caching improves throughput.
40+
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.
41+
42+
Locking applies on the *cache level*, not per *cache entry*.
3943

4044
It is possible to opt in to the locking behavior as follows:
4145

0 commit comments

Comments
 (0)