xSpeed Cache is officially live! Get 50% OFF during Launch Week — Lifetime starts at just $79Lifetime from $79 — 50% OFF, Launch Week! See Plans →

See Plans →
Features
xSpeed Hub Pricing Docs Blog Scan
Appearance
Get Plugin
NC

Set up the Redis object cache with NanoClaw

Setting up a Redis object cache with NanoClaw means messaging your self-hosted agent from a chat app to check, test and enable Redis on a WordPress site through xSpeed Hub, and to report on it later on a schedule.

get_object_cache_statustest_object_cacheget_settingsupdate_settingstoggle_object_cacheflush_object_cache

Last updated: October 2026

Example session · NanoClaw

You: @Andy use xSpeed Hub to set up Redis on blog. Test first.

get_object_cache_status(site: blog) read-only
→ Drop-in not installed. Backend: Redis configured.

test_object_cache(site: blog) read-only
→ Connected. Probe value written and read back.

NanoClaw: Redis answers from blog's server and the drop-in is not installed yet. Enable the object cache on blog?

You: Yes, enable it.

toggle_object_cache(site: blog, enabled: true) changes site
→ Drop-in installed. Redis active.

get_object_cache_status(site: blog) read-only
→ Drop-in installed. Backend: Redis, connected.

NanoClaw: Redis is the object cache for blog. Want a weekly Redis test posted here?

01

How NanoClaw handles this

You are in the Slack channel where your NanoClaw agent listens, and blog has just moved to a hosting plan with Redis. You message the agent with its trigger word: set up Redis on blog, test first. The agent calls get_object_cache_status through xSpeed Hub, which reports whether the object-cache.php drop-in is installed, which backend is configured and its stats, then test_object_cache, which makes the site connect to Redis and write and read a probe value. The status alone never proves Redis answers, so the test always comes second.

What comes back is a short report in the channel and a question. When the probe passes, the agent proposes toggle_object_cache with enabled set to true, and the Hub tells the agent to briefly confirm intent for the object-cache toggles, so it asks in the thread. After your yes it enables, which installs the drop-in and writes the connection constants into wp-config.php, and then reads the status again. If the probe fails, the server's own error comes back, such as a wrong password or a refused connection, and the fix is on the host. The site would refuse to enable anyway, stopping with Could not enable.

What differs in NanoClaw is that the agent and its rules are yours. It runs in a container on your machine, the Hub is one server on one agent group, and whether it prompts before an MCP tool depends on your fork. The Hub has no confirmation step of its own, so the firm stop is the connection token the group sends: with Read-only everywhere on, the status and the test still work and the Hub refuses the toggle and the flush. Scheduled tasks suit the follow-up, such as a weekly test posted to the channel.

02

Set up NanoClaw once

Already connected? Skip to the prompts. Alternatives and troubleshooting are on the NanoClaw guide.

1Put your sites in xSpeed Hub

Sign in at app.xspeedcache.com with Google or email; the Hub is free and has no site cap. Then connect each WordPress site from its own dashboard: click Connect Hub in the xSpeed Cache top bar, then Connect via xSpeed Hub. Each site needs the free xSpeed Cache plugin.

2Add xSpeed Hub to your agent group

Copy the connection token from Connect AI in the Hub (only the workspace owner sees it). Then run this on the machine that hosts NanoClaw, with your agent group's ID from ncl groups list. The header goes in as a JSON object, because NanoClaw refuses credentials inside the URL. NanoClaw may ask an admin to approve the change.

Terminal
ncl groups config add-mcp-server --id <group-id> --name xspeedhub \
  --url https://app.xspeedcache.com/xspeed/mcp \
  --headers '{"Authorization":"Bearer <your connection token>"}'

3Restart the group and ask

The new server takes effect after a restart. Then message your agent with its trigger word, @Andy by default, and ask something that names xSpeed Hub.

Terminal
ncl groups restart --id <group-id>
1 / 3

Full NanoClaw setup, sign-in options and FAQ

Before you send a prompt that changes something

Reads change nothing on your sites, though contact_support emails xSpeed support. Writes run once your connection allows them, so your client's approval prompt and a read-only connection (the token's Read-only everywhere switch, or a Viewer sign-in) are the gates that matter. Whether NanoClaw asks you before an MCP tool runs depends on how your fork and its admins are set up; its documentation gates adding a server behind approval but describes no per-tool prompt for calls. xSpeed Hub has no confirmation step of its own, so a write runs as soon as the agent calls it and your connection allows writes. The Hub tells the agent to confirm the target site and to ask once before a write that touches every site, which in NanoClaw shows up as a question in the chat. The firm stop is the token: with Read-only everywhere on, the Hub refuses every write tool. Keep it on for scheduled tasks.

03

What do I ask?

Three prompts written for NanoClaw. More for this job are below.

Prompt for NanoClaw
@Andy use xSpeed Hub to set up Redis on blog. Test first and ask me before you enable.
Prompt for NanoClaw
@Andy with xSpeed Hub, check the object cache status on shop and tell me if it is degraded.
Prompt for NanoClaw
@Andy use xSpeed Hub to flush the object cache on blog, asking me first. Old options survived a purge.
04

What happens, step by step

A persistent object cache keeps database query results in Redis or Memcached instead of rebuilding them on every request. Through xSpeed Hub an agent can read the state of the cache, probe the cache server, switch the cache on or off, and flush it. The Hub tells the agent to run the probe first, because the status call alone does not prove the server is reachable.

01

Read the current state

get_object_cache_status reports whether the object-cache.php drop-in is installed, which backend is configured, Redis or Memcached, and its stats. It does not prove the server answers, so a clean status is not a green light.

02

Test the connection first

test_object_cache opens a live connection to the configured server and does a read and write probe with the settings saved on the site. A failure comes back with the server's own reason, such as a wrong password, a refused connection or a permission error. The Hub tells the agent to run this before toggle_object_cache.

03

Fix the connection if the test fails

get_settings reads the object-cache module, with secrets masked. update_settings changes it, for example the host or port. On a managed host that defines these values in wp-config.php, the fields are read-only and a write that tries to change one is refused with the name of the constant. For a host that wants the constants pasted, get_object_cache_status with detail set to snippet returns the wp-config.php block.

04

Turn it on

toggle_object_cache with enabled true makes the site test the connection again, write the connection constants into wp-config.php and install the object-cache.php drop-in. If the test fails, it stops with "Could not enable" and writes nothing. If wp-config.php is not writable, the drop-in goes in and the reply tells you to add the snippet by hand. The Hub tells the agent to briefly confirm intent first.

05

Check it took

The drop-in loads on the next request, so the agent reads get_object_cache_status again after a page load and runs test_object_cache once more. The status also warns when the cache connects but refuses writes, so a connected cache that stores nothing does not pass as healthy.

06

Flush when stale data survives

flush_object_cache empties the persistent object cache. Use it when old options, transients or query results outlive a page cache purge. It does not touch the page cache; purge_cache does that.

05

Reference

Read toolsget_object_cache_status and test_object_cache, both work on a read-only connection
Write toolstoggle_object_cache (enabled true or false) and flush_object_cache
BackendsRedis or Memcached
Status detailstatus (default) or snippet, the wp-config.php constants block
What status provesDrop-in installed, backend configured, stats. Not that the server is reachable
What the test provesA live connect and a read and write probe on the saved settings, with the server's own error on failure
Enable doesTests the connection, writes connection constants to wp-config.php, installs the object-cache.php drop-in
Disable doesRemoves xSpeed's drop-in and its wp-config.php block; a drop-in owned by another plugin is left alone
Connection timeout1 second by default, set in the object-cache module
Settings moduleobject-cache, for get_settings and update_settings
Every site at onceNone of these tools accept site: "all"; one site per call
ConfirmationNone on the Hub; your client's prompt is the gate
06

Rules worth keeping

  • Test before you toggle. The Hub tells the agent to run test_object_cache first, because a cache server that does not answer slows every request while the page cache still looks healthy.
  • Keep the Redis password out of the chat. get_settings masks it, but the wp-config.php snippet is built from the saved settings and can include a saved password. Set secrets in wp-config.php or in the xSpeed panel.
  • toggle_object_cache and flush_object_cache are write tools. The Hub tells the agent to briefly confirm intent for the object-cache toggles, but that is guidance, not a lock. Your client's approval prompt and a read-only grant are the gates that matter. A read-only grant means the connection token with Read-only everywhere on, or a Viewer member's sign-in; an OAuth sign-in gets the scopes the client asks for, which are read and write by default.
  • If another plugin owns the object-cache.php drop-in, turn its object cache off in that plugin. xSpeed leaves a drop-in it did not install in place when you disable.
  • A flush clears cached data, so the next requests rebuild it from the database and the site is briefly slower. Flush one site, then check it, before you repeat it.

Good to know with NanoClaw

A scheduled task created with ncl tasks create has no chat attached, so the prompt must name where to send the result, and nobody is there to answer a question about a write. Keep it to get_object_cache_status and test_object_cache, and send it through a group whose token has Read-only everywhere on. The token lives in the group's container configuration on your host, so protect that machine and its backups. Do not ask for the wp-config.php snippet in a shared channel, because it can include a saved password.

07

More prompts for this job

They work in any client connected to xSpeed Hub.

Prompt
Using xSpeed Hub, is a persistent object cache running on shop, and which backend does it use?
Prompt
Use xSpeed Hub to test whether Redis is reachable from shop. Do not change anything.
Prompt
Shop is slow in wp-admin. Use xSpeed Hub to check the object cache before anything else.
Prompt
With xSpeed Hub, test Redis on shop, and if it passes, turn the object cache on.
Prompt
Ask xSpeed Hub for the wp-config.php object cache snippet for docs.
Prompt
Use xSpeed Hub to flush the object cache on blog. Old options survive a page cache purge.
Prompt
With xSpeed Hub, turn the object cache off on shop and confirm the drop-in is gone.
08

Frequently asked questions

Yes. ncl tasks create runs a prompt on a cron schedule. A scheduled task has no chat attached, so name the channel in the prompt, and keep it to the status and the test, because nobody is there to approve a toggle.

No. None of the object-cache tools accepts every site at once, so the agent works one site per call. Ask for each site by name, and let each pass its own test before the cache goes on.

Because a cache server that does not answer costs time on every request while the page cache still looks fine. The Hub tells the agent to run test_object_cache first, and the site also tests the connection when you enable and refuses to continue if it fails. The probe is still worth running on its own, since it returns the server's exact reason, such as a wrong password or a refused connection.

The site keeps working. The drop-in is built never to take the site down: it falls back to WordPress's own cache for the length of the request and marks itself as degraded. A request can still wait up to the connection timeout, which is 1 second by default, so the site gets slower. xSpeed reports that state as degraded, and test_object_cache names the fault.

No. These tools connect xSpeed to a Redis or Memcached server that already exists and switch the object cache on or off. Getting a server is a hosting task. xSpeed uses the phpredis extension when it is there and its own built-in client when it is not.

flush_object_cache empties the persistent object cache and nothing else. purge_cache with type object does the same job through the purge tool, and purge_cache with type all also clears the page cache and, when connected, the Cloudflare edge. Use the flush when stale options or transients survive a page cache purge.

Treat it like a secret. The snippet is built from the settings saved on the site, so it can contain the Redis password if one is saved. Paste it into wp-config.php yourself and avoid sharing it in a chat or a ticket.

09

Keep going

Set up Redis object cache with other agents

More with NanoClaw

Documentation

From the blog

Set up Redis object cache, from NanoClaw.

xSpeed Hub is free and has no site cap. Connect your sites once and ask from the agent you already use.