Current development version of redis contains a new feature: keyspace notifications. Documentation: http://redis.io/topics/notifications
Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way.
Examples of the events that is possible to receive are the following:
- All the commands affecting a given key.
- All the keys receiving an LPUSH operation.
- All the keys expiring in the database 0.
Hopefully, it will make it to stable soon.
BTW, it won’t be very useful in helping you save values of expired keys. When expiration event is fired, the value is gone already.