News for hackers. Stuff that matters.
Re:Redis server side if-modified-since caching pattern using... by irthomasthomas on Tuesday June 22, 2021 @08:11AM (#27590660)
You can do something similar using the Expire TTL by setting a date way in the future.

  redis-cli SETEX mykey 310536000000 "helllooo"
   myttl = $(redis-cli TTL mykey)
   mdate = 310536000000 - $myttl
Re:Redis server side if-modified-since caching pattern using... by derefr on Tuesday June 22, 2021 @11:47AM (#27593182)
Only if you have distinct keys. Most Redis use I’ve seen “at scale” has involved putting things in hashes/sets/lists.

(I’ve wondered for a while now whether it’d be possible to implement expiry in Redis for sub-key data, without introducing too much overhead to data structures that don’t need expiry. I’d think it’d be “just” a matter of having an alternative data representation that holds expiries for each element in the data structure, and then re-encoding the data structure over to that data representation when at least one element has an expiry — because if one does, then it’s likely that many will.)