You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redis 7.4 introduces notably HEXPIRE, that extend EXPIRE to individual keys of a hash function. This is quite practical for many reasons, for instance I use it to count the number of connected users on each server, and the HEXPIRE allows me to remove keys when the server has been offline for too long (e.g. due to a crash).
The problem/use-case that the feature addresses
Redis 7.4 introduces notably HEXPIRE, that extend EXPIRE to individual keys of a hash function. This is quite practical for many reasons, for instance I use it to count the number of connected users on each server, and the HEXPIRE allows me to remove keys when the server has been offline for too long (e.g. due to a crash).
More generally, here are the new commands introduced in 7.4, from https://raw.githubusercontent.com/redis/redis/7.4/00-RELEASENOTES:
HEXPIRE
andHPEXPIRE
set the remaining time to live for specific fieldsHEXPIREAT
andHPEXPIREAT
set the expiration time to a UNIX timestamp for specific fieldsHPERSIST
removes the expiration for specific fieldsHEXPIRETIME
andHPEXPIRETIME
get the expiration time for specific fieldsHTTL
andHPTTL
get the remaining time to live for specific fieldsDescription of the feature
Same as in https://redis.io/docs/latest/commands/hexpire/
Alternatives you've considered
Creating keys for each item… but then it is hard to keep track of them all, as KEYS is not recommended in production: https://stackoverflow.com/questions/30728973/redis-get-all-keys-values-from-redis-with-prefix
The text was updated successfully, but these errors were encountered: