{
  "schema_version": 2,
  "id": "commands/persist",
  "title": "PERSIST",
  "url": "https://redis.io/docs/latest/commands/persist/",
  "summary": "Removes the expiration time of a key.",
  "since": "2.2.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-07-24T11:07:00+02:00",
  "page_type": "content",
  "content_hash": "5081a7f40b375e1689496e78e282cb22ea28766860c9281c9a91ce178aa91d18",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Remove the existing timeout on `key`, turning the key from _volatile_ (a key\nwith an expire set) to _persistent_ (a key that will never expire as no timeout\nis associated)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> SET mykey \"Hello\"\nOK\nredis> EXPIRE mykey 10\n(integer) 1\nredis> TTL mykey\n(integer) 10\nredis> PERSIST mykey\n(integer) 1\nredis> TTL mykey\n(integer) -1"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Integer reply](../../develop/reference/protocol-spec#integers): `0` if _key_ does not exist or does not have an associated timeout.\n* [Integer reply](../../develop/reference/protocol-spec#integers): `1` if the timeout has been removed.\n\n**RESP3:**\n\nOne of the following:\n* [Integer reply](../../develop/reference/protocol-spec#integers): `0` if _key_ does not exist or does not have an associated timeout.\n* [Integer reply](../../develop/reference/protocol-spec#integers): `1` if the timeout has been removed."
    }
  ],
  "examples": []
}
