# Tune WordPress cache settings with Antigravity

> Tuning cache settings with Antigravity means asking its agent, in the editor, to audit an xSpeed module on a WordPress site, write up the change it would make, and apply it through xSpeed Hub only when you say so.

Page: https://xspeedcache.com/agent/antigravity/cache-settings/
Last updated: October 2026

You are in Antigravity with a site you inherited, and you do not yet know how its caching is set up. You ask the agent for an audit before it touches anything: which modules are on, what the cache lifetime and exclusions are, and what it would change and why. It calls list_sites, then list_modules for the module list and status, then get_settings for the modules that matter to caching, and writes a short report with a ranked list of suggestions.

What comes back is a report, not a write, and that is the point of starting here. Every suggestion names the module, the current value, the new value and the effect, so you can accept two and skip three. When you say yes to one, the agent calls update_settings for just that setting, and the Hub tells it to briefly confirm intent first. The result is the stored module settings. If any key or value is wrong, the whole call is refused and nothing is stored, a Pro-only module is refused on a site without a licence, and credential fields are refused over the Hub.

What differs in Antigravity is that it runs MCP tools in Ask mode by default, so each call waits for your approval in a card before it executes. Allow rules such as mcp(xspeedhub/get_settings) or mcp(xspeedhub/*) skip the prompt, Deny and Ask rules beat Allow, and the Turbo permission preset allows MCP actions without asking. Allow the reads by name and keep update_settings and toggle_cache on Ask. The card also lets you edit its target string to widen the grant, so read it before you widen anything. The Hub runs a write as soon as the connection allows it.

## Set up Antigravity 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 mcp_config.json

Antigravity reads ~/.gemini/config/mcp_config.json for every project, or .agents/mcp_config.json inside one workspace. In the IDE, open the ... menu at the top of the agent side panel, choose MCP Servers, then Manage MCP Servers and View raw config. Remote servers must use the serverUrl field; the older url and httpUrl fields are not supported.

File: `~/.gemini/config/mcp_config.json`

```json
{
  "mcpServers": {
    "xspeedhub": {
      "serverUrl": "https://app.xspeedcache.com/xspeed/mcp"
    }
  }
}
```

### 3. Authenticate

Open Agent settings with Cmd+, on macOS or Ctrl+, on Windows and Linux, go to the Customizations tab and click Authenticate next to xspeedhub. Sign in to xSpeed Hub in the browser and approve access, copy the authorization code the page shows, paste it into the settings panel and click Submit. Antigravity keeps the credentials it receives and refreshes them. In the CLI, type /mcp to open the MCP manager and check the server status.

```
Settings → Customizations → Authenticate
```

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

### 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. Antigravity runs unconfigured MCP tools in Ask mode, so each call waits for your approval in a card before it executes. Allow rules such as mcp(xspeedhub/get_cache_status) or mcp(xspeedhub/*) let calls through without a prompt, Ask and Deny rules take precedence over Allow, and the Turbo permission preset allows MCP and web actions without asking. When you approve a card you can also edit its target to widen the grant. With Turbo or a broad allow rule, a write reaches the Hub as soon as your connection allows writes. xSpeed Hub has no confirmation step of its own.

## Prompts

- Use xSpeed Hub to audit the caching settings on shop and give me a ranked list of changes, without applying any of them.
- With xSpeed Hub, compare the cache expiry and exclusions on blog and shop and tell me which site is set up better, and why.
- Ask xSpeed Hub to apply only the first suggestion from your audit to shop, and show me the setting before and after.

## Example session

```
You: I inherited shop. Use xSpeed Hub to audit its cache settings and tell me what you would change. Do not change anything.
  → list_modules(site: shop) [read-only]: cache on, minify on, browser cache off
  → get_settings(site: shop, module: cache) [read-only]: cache expiry 2 hours, 1 excluded URL
Agent: Two suggestions. Cache expiry is 2 hours, which rebuilds pages often; unless the store changes several times a day, 24 is more fitting. Browser cache headers are off, so returning visitors re-download files. I have changed nothing. Tell me which to apply.
```

## How it works

1. **List the modules**: list_modules returns every Free and Pro module available on one site, with its settings schema and status. It tells the agent which module slugs exist, such as minify or gzip, and what each setting accepts.
2. **Read the current settings**: get_settings takes a module slug and returns its settings. Credential fields come back masked, so an agent cannot read a stored API token or password back in plain text.
3. **Change them**: update_settings takes the module and a values object of setting keys. The site checks the whole object first. If any key is unknown, any value is outside the schema, or a field is pinned by a constant in wp-config.php, it refuses the write, writes nothing and says which keys and why, sometimes with a "did you mean" hint.
4. **Turn page caching on or off**: Page caching has its own tool, toggle_cache, because it installs or removes the cache drop-in and the WP_CACHE constant. Asking update_settings to set cache_enabled does not work and is refused. If another caching plugin owns the drop-in, the site declines to enable xSpeed and returns blocked: true with the reason.
5. **Check the effect**: The result of a settings write is the stored settings. A module can add a warning when a setting is saved but has no effect on this server, for example Brotli on a server without the module for it, and the agent should pass that on. run_benchmark then times cached against uncached to see whether the change helped.
6. **Apply to many sites only after reading one**: update_settings and toggle_cache accept site: "all" or a list of handles. Each site validates against its own schema and answers in its own row, so a module missing on one site fails that row and the others still apply. Read one site first, then apply.

## Reference

| | |
| --- | --- |
| Discover | list_modules (read): Free and Pro modules, settings schema, status, per site |
| Read settings | get_settings (read): argument module; credential fields masked |
| Change settings | update_settings (write): arguments module and values; validated by the site |
| Bad input | The whole write is refused and nothing is written; the error names the keys and reasons |
| Page cache on or off | toggle_cache (write): argument enabled; cache_enabled in update_settings is refused |
| Blocked by another plugin | toggle_cache returns blocked: true with blocked_reason when another plugin owns the cache drop-in |
| Every site at once | update_settings and toggle_cache accept site: "all" or a list of handles, one result per site |
| Pro modules | A Pro module on a site without an active licence cannot be read or written; the site refuses |
| Credential fields | Refused by default over MCP; set them in the xSpeed dashboard, not through the agent |
| Read-only connection | The connection token with Read-only everywhere on, or a Viewer member's sign-in: update_settings and toggle_cache are refused; list_modules and get_settings still work. An OAuth sign-in gets the scopes the client asks for, read and write by default, clamped to the member's role |
| Confirmation | None on the Hub; the Hub tells the agent to briefly confirm intent for these two, and your client's prompt is the gate |

## Rules

- Read before you write. Ask for list_modules and get_settings first, so the agent changes real keys with valid values instead of guessing.
- update_settings and toggle_cache change how a live site behaves. They run as soon as your connection allows writes. The Hub tells the agent to briefly confirm intent first, which is guidance to the agent, so your client's approval prompt and a read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in) are the gates. The switch does not limit an OAuth sign-in.
- For site: "all", the Hub tells the agent to confirm once with "this will touch all N sites", then make one call. The result is per site, and some sites failing is a partial result to report, not a blanket success or failure.
- Do not ask an agent to set credentials such as a Cloudflare token or Redis password. The site refuses those writes by default, and they belong in the xSpeed dashboard.
- If a settings result says a value is saved but inactive on this server, relay that. Do not tell the user the feature is enabled.

## Good to know with Antigravity

Under the Turbo preset, or with an mcp(xspeedhub/*) allow rule, update_settings and toggle_cache run without a prompt and the Hub's request to confirm is the only brake. Add an Ask rule for the write tools if you use Turbo. For the audit you can also use a read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in): the Hub then refuses update_settings and toggle_cache whatever the agent decides, so a surprise write cannot happen.

## More prompts for this job

They work in any client connected to xSpeed Hub.

- Use xSpeed Hub to list the modules on shop and tell me which ones are off.
- Ask xSpeed Hub for the current minify settings on blog.
- With xSpeed Hub, turn on HTML minification on blog, then benchmark the cache and tell me if it helped.
- Use xSpeed Hub to turn page caching off on staging while I debug, and tell me when it is off.
- Using xSpeed Hub, read the gzip settings on shop first, then enable the same options on every site.
- Use xSpeed Hub to set the page cache lifespan on docs to 30 days, and if the site refuses it, tell me why.

## Frequently asked questions

### Can I use Antigravity only to read my xSpeed settings?

Yes. Send the connection token in a header and turn on the Read-only everywhere switch on the Hub's Connect AI page, or sign in as a Viewer member of the workspace. The switch changes only the connection token; an OAuth sign-in gets the scopes Antigravity asks for. The agent can then call list_modules and get_settings, and the Hub refuses every write tool with a message that the connection is read-only.

### Will Antigravity tell me before it applies a suggestion?

By default, yes. Antigravity runs MCP tools in Ask mode and waits for your approval in a card, and the Hub also tells the agent to briefly confirm intent before update_settings. The Hub's request is guidance to the model, not a lock, and the Turbo preset or an allow rule lets a write run without a prompt. A read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in) is the one safe way to be sure nothing is written.

### How does an agent know which settings exist?

It calls list_modules for the site, which returns every available module with its settings schema and status, then get_settings for the one module it wants to change. The schema says which keys exist and what values each accepts.

### What happens if the agent sends a wrong setting key?

The site refuses the whole update and writes nothing. The error names the keys it rejected and why, such as an unknown key, a value outside the allowed range, or a field fixed by a constant in wp-config.php, and it can suggest the nearest valid key.

### How do I turn page caching on or off with an agent?

Use toggle_cache with enabled set to true or false. It installs or removes the cache drop-in and the WP_CACHE constant. Setting cache_enabled through update_settings does not work. If another caching plugin already owns the drop-in, the site will not enable xSpeed and says why.

### Can one prompt change settings on all of my sites?

Yes. update_settings and toggle_cache accept site: "all", and the Hub runs the sites one after another with a one-second pause and returns a result per site. Each site checks the values against its own schema, so a site that lacks the module fails its own row while the others apply.

### Can the agent change my Cloudflare or Redis credentials?

Not by default. Writing credential fields over MCP is off unless the site owner allows it, and the site refuses the write and names the fields. Set credentials in the xSpeed dashboard. Credential values also come back masked when an agent reads settings.

## Tune cache settings with other agents

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

## More with Antigravity

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

## Documentation

- How to enable Page Cache: https://xspeedcache.com/docs/page-cache/
- How to minify CSS and JavaScript: https://xspeedcache.com/docs/minify/
- How to add cache rules and bypasses: https://xspeedcache.com/docs/rules-and-bypass/
- Site MCP tool reference: https://xspeedcache.com/docs/mcp-tool-reference/
