How Zed handles this
You are in Zed with the agent panel open, and the site you are working on makes too many database queries per request. Type: set up Redis for shop, and test before enabling. The agent calls get_object_cache_status through xSpeed Hub, which reports the object-cache.php drop-in state, the configured backend and its stats. It does not prove that Redis answers, so the agent has to test next.
Zed's default tool permission is to confirm, which means every call stops for a prompt, reads included. Expect one for the status call, another for test_object_cache and a third for toggle_object_cache. The test connects the site's plugin to Redis, writes a probe value and reads it back, and a failure returns the server's own error. When it passes, you approve toggle_object_cache with enabled set to true, which installs the drop-in. If it fails, decline and fix the host side.
That makes Zed the easiest agent here to keep in step with, because nothing the agent calls runs unseen. A prompt for a read is only noise, but it also means the toggle never slips through on a loose setting. The editor runs on your machine and Redis lives on the site's server, so the check of Redis itself comes from the site through the test tool, not from anything Zed can run locally. After the toggle, ask the agent to read the status once more and run the test again, which gives you two more prompts and a clear confirmation that the drop-in loaded.
Set up Zed once
Already connected? Skip to the prompts. Alternatives and troubleshooting are on the Zed 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 remote server
Open Settings, then AI, then MCP Servers, click Add Server and choose Add Remote Server. Or run zed: open settings file and add the entry yourself. Zed calls MCP servers context servers, so the key is context_servers.
{
"context_servers": {
"xspeedhub": {
"url": "https://app.xspeedcache.com/xspeed/mcp"
}
}
} 3Sign in
Because the entry has no Authorization header, Zed prompts you to authenticate against the server with the standard MCP OAuth flow. Approve access on the xSpeed Hub page that opens. There is no token to paste. Back in Settings, AI, MCP Servers, a green dot beside xspeedhub with the tooltip Server is active means it is connected.
Settings → AI → MCP Servers
Full Zed 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. The Zed agent confirms before it runs any tool action. The default setting, agent.tool_permissions.default, is confirm, and that covers MCP tool calls, reads included. A per-tool entry such as mcp:xspeedhub:get_cache_status with a default of allow lets that one tool run without a prompt, and the Always for tool button in the prompt writes the same entry. Setting the global default to allow auto-approves every tool, writes included, and then a write reaches the Hub as soon as your connection allows writes. xSpeed Hub has no confirmation step of its own.
What do I ask?
Three prompts written for Zed. More for this job are below.
Using xSpeed Hub, check the object cache on shop and tell me what the status says about the drop-in and backend.
Use xSpeed Hub to run test_object_cache on shop and explain the result in two sentences.
With xSpeed Hub, enable the object cache on shop after the Redis test passes, then check the status again.
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.
Reference
| Read tools | get_object_cache_status and test_object_cache, both work on a read-only connection |
|---|---|
| Write tools | toggle_object_cache (enabled true or false) and flush_object_cache |
| Backends | Redis or Memcached |
| Status detail | status (default) or snippet, the wp-config.php constants block |
| What status proves | Drop-in installed, backend configured, stats. Not that the server is reachable |
| What the test proves | A live connect and a read and write probe on the saved settings, with the server's own error on failure |
| Enable does | Tests the connection, writes connection constants to wp-config.php, installs the object-cache.php drop-in |
| Disable does | Removes xSpeed's drop-in and its wp-config.php block; a drop-in owned by another plugin is left alone |
| Connection timeout | 1 second by default, set in the object-cache module |
| Settings module | object-cache, for get_settings and update_settings |
| Every site at once | None of these tools accept site: "all"; one site per call |
| Confirmation | None on the Hub; your client's prompt is the gate |
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 Zed
Zed prompts for every call by default, including get_object_cache_status and test_object_cache, so a full setup is at least three confirmations. If you relax that, do it narrowly: add a per-tool entry such as mcp:xspeedhub:get_object_cache_status with a default of allow for each of the two reads, or press Always for tool in the prompt, and leave the two writes on confirm. Zed documents no wildcard for MCP tools. Setting the global default to allow auto-approves every tool, and the Hub adds no confirmation of its own, so Zed's tool permission setting is what stands between the agent and toggle_object_cache or flush_object_cache.
More prompts for this job
They work in any client connected to xSpeed Hub.
Using xSpeed Hub, is a persistent object cache running on shop, and which backend does it use?
Use xSpeed Hub to test whether Redis is reachable from shop. Do not change anything.
Shop is slow in wp-admin. Use xSpeed Hub to check the object cache before anything else.
With xSpeed Hub, test Redis on shop, and if it passes, turn the object cache on.
Ask xSpeed Hub for the wp-config.php object cache snippet for docs.
Use xSpeed Hub to flush the object cache on blog. Old options survive a page cache purge.
With xSpeed Hub, turn the object cache off on shop and confirm the drop-in is gone.
Frequently asked questions
Keep going
Set up Redis object cache with other agents
More with Zed
Documentation
- How to enable Redis or Memcached
- How to enable Page Cache
- Common problems and troubleshooting
- How to write prompts for xSpeed Hub
- Zed + xSpeed
- Every AI agent that works with xSpeed
From the blog