# Purge the WordPress cache with NanoClaw

> Purging the WordPress cache with NanoClaw means messaging your self-hosted agent in a chat app with its trigger word and having it clear the xSpeed cache through the xspeedhub server on its agent group.

Page: https://xspeedcache.com/agent/nanoclaw/purge-cache/
Last updated: October 2026

NanoClaw lives in the chat apps you already use, so a purge is a message. You changed the footer in your shared theme, and from Telegram you write: @Andy use xSpeed Hub to purge the page cache on every site. The agent in that group's container calls list_sites, then purge_cache, and answers in the same chat. A message is a natural place for a result per site, so a site that failed is a line in the reply rather than something you have to dig for.

The server was added to the agent group with ncl groups config add-mcp-server, the Hub's address and an Authorization: Bearer header holding the connection token, and the group was restarted to pick it up. For a purge the token has to allow writes, so Read-only everywhere must be off. The plugin reports the type, the site, how many entries were cleared, and for a purge of type all the object cache and a connected Cloudflare edge. With site: "all" the Hub runs the sites one after another and returns one result each, which is what lets the agent say landing did not answer while the others purged.

Whether NanoClaw prompts before a tool call 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 the calls themselves. xSpeed Hub has no confirmation step of its own, so a purge runs once the agent calls it and your connection allows writes. For a purge of every site, the Hub tells the agent to say it will touch all of them and wait for your yes, which in NanoClaw is a question in the chat, but that is guidance to the model, not a lock.

## Set up NanoClaw once

### 1. Put 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.

### 2. Add 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.

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

### 3. Restart 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.

```bash
ncl groups restart --id <group-id>
```

Full setup: https://xspeedcache.com/agent/nanoclaw/

### 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.

## Prompts

- @Andy use xSpeed Hub to purge the page cache on every site and tell me which ones failed.
- @Andy with xSpeed Hub, purge only the assets cache on blog, then start the preloader.
- @Andy use xSpeed Hub to read the cache status on shop and tell me whether it needs a purge. Do not purge yet.

## Example session

```
You: @Andy I changed the shared footer. Use xSpeed Hub to purge the page cache on every site.
  → list_sites [read-only]: 4 sites: shop, blog, docs, landing
Agent: That is one purge_cache call with type page across all 4 sites. Go ahead?
You: Yes.
  → purge_cache(site: all, type: page) [changes site]: 4 sites: 3 purged, landing unreachable
Agent: shop, blog and docs are purged. landing did not answer, so its old footer is still cached there. Try landing again now?
You: Yes, try it.
  → purge_cache(site: landing, type: page) [changes site]: 58 cached pages cleared
Agent: landing answered this time and 58 pages were cleared. All four sites now serve the new footer.
```

## How it works

1. **Find the site**: The agent calls list_sites when you have more than one site, then matches the name you used to a site handle. If the name could mean two sites, the Hub tells it to ask you rather than guess.
2. **Pick the purge type**: purge_cache takes a type: all, page, assets, object or rest. all clears the page cache, the object cache and, when they are connected, the Cloudflare edge and CDN. After a theme or CSS change, assets is enough; after a content edit, page; after a deploy, all.
3. **Purge**: The call runs straight away on that site once your connection allows writes. For every site at once the agent passes site: "all", and the Hub runs the sites one after another with a one-second pause.
4. **Clear only the edge if that is all you need**: purge_cloudflare empties the Cloudflare edge cache on its own, without touching the copies on your server. A page or assets purge does not reach Cloudflare; a purge of type all does when Cloudflare is connected.
5. **Warm it again**: start_preloader rebuilds the cache in the background so the first visitors after the purge are not the ones paying for it.

## Reference

| | |
| --- | --- |
| Tool | purge_cache (write) |
| Purge types | all, page, assets, object, rest |
| What all covers | Page cache, object cache, plus the Cloudflare edge and CDN when connected |
| Every site at once | site: "all" or a list of handles, one result per site |
| Fan-out pacing | Sites run one after another with a 1 second pause |
| Edge only | purge_cloudflare, a separate write tool |
| Re-warm | start_preloader after the purge |
| Read-only access | purge_cache is refused on a connection token with Read-only everywhere on, and for a Viewer sign-in |
| Confirmation | None on the Hub; your client's prompt is the gate |

## Rules

- Name the site. With several sites, an unclear name should make the agent ask, and the Hub tells it to.
- A purge of every site is one call with site: "all". The Hub tells the agent to confirm it with you once before it runs.
- Purge the narrowest type that fixes the problem, then warm the cache, so visitors do not all hit uncached pages at once.
- A fan-out result is reported per site. Treat some sites failing as a partial result, not a failure of the whole call.

## Good to know with NanoClaw

The token in the group's container configuration is the whole permission model here. With Read-only everywhere off, anyone who can message the agent with its trigger word in that chat can ask it to purge your sites, and in a group chat that may be more people than you expect. Add the server only to agent groups whose chats you control, or hold the token in NanoClaw's credential gateway as its gateway documentation describes. Keep scheduled tasks from ncl tasks create to reads, because a task has no conversation attached and nobody can answer the Hub's ask-once question. Turning Read-only everywhere on stops every purge, and it applies to every client that sends the same token.

## More prompts for this job

They work in any client connected to xSpeed Hub.

- Use xSpeed Hub to purge the page cache on blog.
- I just changed the theme CSS on shop. Use xSpeed Hub to purge only the assets cache there.
- With xSpeed Hub, purge every site in my workspace and tell me which ones failed.
- Use xSpeed Hub to purge shop, then purge its Cloudflare edge cache too.
- With xSpeed Hub, purge the docs site and start the preloader so it is warm again.
- Using xSpeed Hub, what purge type should I use after updating a plugin that changes the checkout page?

## Frequently asked questions

### Can NanoClaw purge my WordPress cache from a chat app?

Yes. Add xSpeed Hub to the agent group with ncl groups config add-mcp-server and a connection token that allows writes, restart the group, and message the agent with its trigger word. It calls purge_cache and replies with a result per site.

### Who can ask NanoClaw to purge my sites?

Anyone who can message the agent with its trigger word in a chat where it answers, because the token on the agent group is what the Hub checks. xSpeed Hub has no confirmation step of its own. Keep the server on groups you control, or turn on Read-only everywhere on the token to stop every purge.

### What is the difference between the purge types?

all clears every cache xSpeed manages for the site, including a connected Cloudflare zone or CDN. page clears the stored HTML pages, assets clears minified and combined CSS and JavaScript, object clears the Redis or Memcached object cache, and rest clears cached REST API responses.

### Does purging xSpeed also clear Cloudflare?

A purge of type all does, when the site has Cloudflare connected in xSpeed: it clears the page cache, the object cache and the Cloudflare edge, and reports each one. A page, assets or rest purge stays on your server. purge_cloudflare clears only the edge.

### Can I purge all of my sites with one prompt?

Yes. The agent passes site: "all" to purge_cache and the Hub purges every site in the workspace one after another, returning a result per site. The Hub tells the agent to confirm a write across every site with you once before it runs it.

### Will a purge slow my site down?

The next request to each purged page builds it fresh, which is slower than a cached hit. Starting the preloader right after the purge rebuilds the cache in the background so visitors mostly land on warm pages.

## Purge the cache with other agents

[Claude Code](https://xspeedcache.com/agent/claude-code/purge-cache/) · [Claude](https://xspeedcache.com/agent/claude/purge-cache/) · [Claude Cowork](https://xspeedcache.com/agent/claude-cowork/purge-cache/) · [ChatGPT](https://xspeedcache.com/agent/chatgpt/purge-cache/) · [Codex](https://xspeedcache.com/agent/codex/purge-cache/) · [Cursor](https://xspeedcache.com/agent/cursor/purge-cache/) · [GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/purge-cache/) · [Windsurf](https://xspeedcache.com/agent/windsurf/purge-cache/) · [Gemini CLI](https://xspeedcache.com/agent/gemini-cli/purge-cache/) · [Antigravity](https://xspeedcache.com/agent/antigravity/purge-cache/) · [Zed](https://xspeedcache.com/agent/zed/purge-cache/) · [Kiro](https://xspeedcache.com/agent/kiro/purge-cache/) · [OpenCode](https://xspeedcache.com/agent/opencode/purge-cache/) · [OpenClaw](https://xspeedcache.com/agent/openclaw/purge-cache/) · [Hermes Agent](https://xspeedcache.com/agent/hermes-agent/purge-cache/) · [Grok Build](https://xspeedcache.com/agent/grok-build/purge-cache/) · [ChatGPT dots](https://xspeedcache.com/agent/chatgpt-dots/purge-cache/) · [Grok](https://xspeedcache.com/agent/grok/purge-cache/) · [Grok Bot](https://xspeedcache.com/agent/grok-bot/purge-cache/) · [Muse](https://xspeedcache.com/agent/muse/purge-cache/) · [Manus](https://xspeedcache.com/agent/manus/purge-cache/) · [Kimi Code](https://xspeedcache.com/agent/kimi/purge-cache/) · [Paperclip](https://xspeedcache.com/agent/paperclip/purge-cache/)

## More with NanoClaw

- [Find out why WordPress pages are not cached with NanoClaw](https://xspeedcache.com/agent/nanoclaw/troubleshoot-cache/)
- [Scan a website for speed problems with NanoClaw](https://xspeedcache.com/agent/nanoclaw/speed-scan/)
- [Run and track PageSpeed tests with NanoClaw](https://xspeedcache.com/agent/nanoclaw/pagespeed-tests/)
- [Raise a WordPress site's PageSpeed score with NanoClaw](https://xspeedcache.com/agent/nanoclaw/optimize-site/)
- [Tune WordPress cache settings with NanoClaw](https://xspeedcache.com/agent/nanoclaw/cache-settings/)
- [Warm the WordPress cache with NanoClaw](https://xspeedcache.com/agent/nanoclaw/preload-cache/)
- [Set up the Redis object cache with NanoClaw](https://xspeedcache.com/agent/nanoclaw/object-cache/)
- [Manage Cloudflare caching with NanoClaw](https://xspeedcache.com/agent/nanoclaw/cloudflare/)
- [Manage every WordPress site at once with NanoClaw](https://xspeedcache.com/agent/nanoclaw/fleet/)

## Documentation

- How to enable Page Cache: https://xspeedcache.com/docs/page-cache/
- How to warm your cache ahead of visitors: https://xspeedcache.com/docs/preloader/
- Managing your fleet with xSpeed Hub: https://xspeedcache.com/docs/managing-your-fleet-with-xspeed-hub/
