Reputation: 2145
On redis.io it is said, that expired keys are not deleted immediately but on access or every once in a while randomly some are deleted.
Does redis remove all expired keys on a save or bgsave? Or does it write the old keys to disk?
Upvotes: 1
Views: 1137
Reputation: 449
You can read rdb.c source code and you will see that expired keys will not be save
/* Save the expire time */
if (expiretime != -1) {
/* If this key is already expired skip it */
if (expiretime < now) continue;
Upvotes: 9