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

Set up the Redis object cache with Claude

Setting up a Redis object cache with Claude means asking it in a chat window to check your site's object cache, test the Redis connection and enable it through the xSpeed Hub connector.

get_object_cache_statustest_object_cacheget_settingsupdate_settingstoggle_object_cacheflush_object_cache

Last updated: October 2026

Example session · Claude

You: Use xSpeed Hub to turn on Redis for my shop site, but test it first.

get_object_cache_status(site: shop) read-only
→ No drop-in installed. Backend: Redis, configured.

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

Claude: Redis answers from the shop server. Enable the object cache on shop now?

You: Yes, go ahead.

toggle_object_cache(site: shop, enabled: true) changes site
→ Drop-in installed. Object cache is on.

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

Claude: Redis is now the object cache for shop, and the status shows the drop-in in place.

01

How Claude handles this

You are in a Claude chat on claude.ai or Claude Desktop, not on the server, and you want WordPress to stop re-running the same database queries on every request. Type something like: turn on Redis for my shop site, but test it first. Claude calls get_object_cache_status through the xSpeed Hub connector, which you switch on from + > Connectors in the message box, and reads back whether the object-cache.php drop-in is installed, which backend is configured and its stats. That one call does not prove that Redis is reachable.

The second call is test_object_cache. The plugin on the site connects to the Redis server, reads and writes a probe value, and Claude relays the result in plain words, including the server's own error when it fails. A passing test is the cue to call toggle_object_cache, and Claude can ask for your approval before it runs that tool. Set the tool to Needs approval under Customize > Connectors so it does. When a test fails nothing has changed yet, so fix the host side first: a wrong password, a closed port, a key prefix your host did not grant. Then ask for the test again.

A chat app has no shell, and that is the difference from a terminal agent. Claude cannot check Redis from the server and cannot edit wp-config.php itself. When the toggle runs, the site writes the connection constants into wp-config.php on its own. If your host expects you to place them by hand, ask for the status with the snippet detail, but know that the snippet is built from saved settings and can contain the Redis password in clear text. It then sits in your chat history, so set the password in wp-config.php or the xSpeed panel instead of pasting it around. Once it is in place, ask Claude to run the test once more.

02

Set up Claude once

Already connected? Skip to the prompts. Alternatives and troubleshooting are on the Claude 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 as a custom connector

Go to Customize > Connectors and click Add custom connector. Name it xspeedhub and paste the URL. Under Authentication choose Sign in now, and if Claude asks how it identifies itself, choose Register automatically, which uses dynamic client registration. Click Add. On a Team or Enterprise plan an Owner does this under Organization settings > Connectors, with Add, then Custom, then Web.

Text
https://app.xspeedcache.com/xspeed/mcp

3Connect and turn it on in a chat

Click Connect on the xspeedhub connector and approve access on the xSpeed Hub page that opens. Then, in a conversation, click + in the message box, choose Connectors and switch xspeedhub on. Claude can use the connector only in conversations where that toggle is on.

Text
+  >  Connectors  >  xspeedhub (on)
1 / 3

Full Claude 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. Claude can ask for your approval before it uses a connector tool. Allow once runs that call, and Always allow skips the prompt for that tool from then on. Under Customize > Connectors you can set each tool, or a group of tools, to Always allow, Needs approval or Blocked. xSpeed Hub has no confirmation step of its own, so a write tool you set to Always allow runs as soon as your connection allows writes. Keep purge_cache, update_settings, toggle_cache and the other write tools on Needs approval, block the ones you never want. For read-only access, sign in as a Viewer member of the workspace, or use the connection token with Read-only everywhere on, which needs the Request headers beta. The switch does not apply to a normal OAuth sign-in.

03

What do I ask?

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

Prompt for Claude
Using xSpeed Hub, check the object cache on shop and tell me whether a drop-in is installed and which backend is configured.
Prompt for Claude
Use xSpeed Hub to test the Redis connection on blog and explain any error in plain words before changing anything.
Prompt for Claude
With xSpeed Hub, enable the object cache on shop once the Redis test passes, then check the status again.
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 Claude

Claude's approval prompt offers Allow once and Always allow. For toggle_object_cache and flush_object_cache, choose Allow once, or set them to Needs approval under Customize > Connectors. Always allow turns the prompt off for that tool in later chats, and the Hub runs a write as soon as your connection permits it. Anthropic notes that Research can call connector tools without further approval, so block the two writes before you use Research with this connector. Also keep the Redis password out of the conversation: the snippet detail of the status call can include it in clear text, so do not ask for it in chat unless you accept that.

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

Not itself. In a chat window Claude has no shell and no file access to your server. It can read the status through xSpeed Hub and call the toggle tool, and on enabling the site writes the constants into wp-config.php. The snippet detail can include a saved Redis password, so keep it out of chat and place it yourself if you need it.

It can. xSpeed Hub is added as a custom connector, and the Free plan allows one. On Team and Enterprise plans an Owner adds the connector under Organization settings, then Connectors, and each member then clicks Connect with their own account.

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 Claude

Documentation

From the blog

Set up Redis object cache, from Claude.

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