PragmaTwice commented on issue #1942: URL: https://github.com/apache/kvrocks/issues/1942#issuecomment-2401325576
> > > Yes, one obstacle we need to overcome is knowing if a key has expired. > > > > > > For me I think we can move the responsibility of expiration detection from the server to clients. i.e. clients should store the key-value cache as well as the TTL. > > For Redis client-side caching, it will send an invalid message notification once it's expired or evicted due to the memory policy. I'm not sure whether most SDKs will add a default TTL for keys or not. If yes, it should be fine. Or it should be a problem since the expiration needs to depend on the compaction timing. It's hard for kvrocks to send notifications on expiration, but for any other writing we can notify, of course. We need to state this point to client implementations to let them store the TTL. It's also recommended in the Redis documentation: > Handling TTLs: make sure you also request the key TTL and set the TTL in the local cache if you want to support caching keys with a TTL. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
