You can do something similar using the Expire TTL by setting a date way in the future.<p><pre><code> redis-cli SETEX mykey 310536000000 "helllooo"
myttl = $(redis-cli TTL mykey)
mdate = 310536000000 - $myttl</code></pre>
Also note that HTTP had it since early days.<p><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If...</a><p>And Apache and other web servers support it out of the box.<p>If your use case allows it consider ditching Redis and rather static cache your generated HTML/json files on the file system while serving. And let Apache serve from there as long as those cached files exist. You get all these features for free.