{
  "schema_version": 2,
  "id": "commands/evalsha_ro",
  "title": "EVALSHA_RO",
  "url": "https://redis.io/docs/latest/commands/evalsha_ro/",
  "summary": "Executes a read-only server-side Lua script by SHA1 digest.",
  "since": "7.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:32+01:00",
  "page_type": "content",
  "content_hash": "77e24ac2e4c97edf37844ee70c015026a874d8849ec1c2ebf2282150032d355c",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "This is a read-only variant of the [`EVALSHA`](https://redis.io/docs/latest/commands/evalsha) command that cannot execute commands that modify data.\n\nFor more information about when to use this command vs [`EVALSHA`](https://redis.io/docs/latest/commands/evalsha), please refer to [Read-only scripts](https://redis.io/docs/latest/develop/programmability#read-only-scripts).\n\nFor more information about [`EVALSHA`](https://redis.io/docs/latest/commands/evalsha) scripts please refer to [Introduction to Eval Scripts](https://redis.io/docs/latest/develop/programmability/eval-intro)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>sha1</code></summary>\n\nThe SHA1 digest of a read-only script previously cached with `SCRIPT LOAD` or `EVAL_RO`.\n\n</details>\n\n<details open><summary><code>numkeys</code></summary>\n\nThe number of key names that follow. Arguments after the keys are passed as regular arguments.\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>key [key ...]</code></summary>\n\nThe key names the script accesses, provided to it via the Lua `KEYS` global variable. There must be exactly `numkeys` of them.\n\n</details>\n\n<details open><summary><code>arg [arg ...]</code></summary>\n\nAdditional arguments provided to the script via the Lua `ARGV` variable.\n\n</details>"
    },
    {
      "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\nThe return value depends on the script that was executed.\n\n**RESP3:**\n\nThe return value depends on the script that was executed."
    }
  ],
  "examples": []
}
