content/commands/persist.md
Remove the existing timeout on key, turning the key from volatile (a key
with an expire set) to persistent (a key that will never expire as no timeout
is associated).
{{% redis-cli %}} SET mykey "Hello" EXPIRE mykey 10 TTL mykey PERSIST mykey TTL mykey {{% /redis-cli %}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="persist-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
0 if key does not exist or does not have an associated timeout.1 if the timeout has been removed.-tab-sep-
One of the following:
0 if key does not exist or does not have an associated timeout.1 if the timeout has been removed.{{< /multitabs >}}