Mention RedisCache locking behavior details.

Closes: #1801
Original Pull Request: #2051
This commit is contained in:
Mark Paluch
2021-04-21 11:16:41 +02:00
committed by Christoph Strobl
parent 1a290c3a96
commit 1fcd9af4c0

View File

@@ -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: