Hi,
Currently, ActiveSupport::Cache::RedisCacheStore uses the DEL
command for deleting cache entries.
However, Redis provides two commands for deleting keys: the familiar DEL
command and the UNLINK
command.
While UNLINK
is very similar to DEL
, it reclaims the memory asynchronously in a separate thread, unlike DEL
which does so synchronously.
(Essentially, UNLINK
immediately unlinks the keys from the keyspace, and the actual memory removal happens later in the background.)
Therefore, I suggest that RedisCacheStore consider using UNLINK
instead of DEL
to potentially improve performance by avoiding blocking operations.
[ref]