Closed
Description
ISSUE
Currently,@keyv/redis
uses the DEL
function to remove entries from the Redis cache. The issue with DEL
is that it is blocking and can take longer the larger the key size, whereas UNLINK
is non-blocking and perform the operation in O(1) for each key removed regardless of its size.
References:
- https://redis.io/commands/unlink/
- https://redis.com/blog/the-little-known-feature-of-redis-4-0-that-will-speed-up-your-applications/
PROPOSED SOLUTION
In @keyv/redis
, modify the delete()
and clear()
functions to use UNLINK
instead of DEL
to improve performance.